Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (36 sloc) 1.78 KB
id title date author layout guid permalink categories
Use Javascript libraries in Adobe Campaign
2018-10-15 14:46:25 +0000
Florian Courgey

Ever wanted to use MomentJS or Lodash in your JS scripts? It's easy to include them via a CDN for client-side web apps, but it can get tricky to get them for server-side processing. This tutorial walks you through the installation of Javascript libraries for Server Side use.

Copy the source code of your library, such as Moment here

Go to your Javascript Codes and create a new one labelled 'vendor:moment'. Paste the code you just copied:


Save it.

Now in a workflow you can use it as any other standard library:


Source code

Step 1/2 Download library

Copy from and paste to vendor:undescore:

//     Underscore.js 1.9.1
//     (c) 2009-2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.
!function(){var n="object"==typeof self&&self.self===self&&self||"object"==typeof global&&[...]

Step 2/2 Use library

In any Javascript activity, you can now use it with loadLibrary('vendor:undescore'):

loadLibrary('vendor:underscore');[1, 2, 3], function(num){ return num * 3; });
// => [3, 6, 9]
You can’t perform that action at this time.