Use
Some features are provided automatically and without setup.
Like syntax highlight, code snippets (and in future document formatting) is available as soon as you start working on your first .ssjs
file in VSCode.
To setup your environment:
The SSJS: Show Setup Walkthrough
gives you an overall guide. However, the major steps are:
- Create (navigate to) a project folder in VSCode and create your first
.ssjs
file..html
and.amp
are also supported, - Create Installed Package (preferably your own for increased security).
- Create your own Cloud Page and Cloud Text Resource in SFMC.
- Run
SSJS: Create Config
command withing VSCode to create your setup file (and store SFMC Credentials safely). - Run the
SSJS: Install Dev Page
command that will help you to deploy your Dev environment in Web Studio. - Save content of
.vscode/dploy.me.
files to Cloud Page and Text resource - don’t forget to Publish.
Note: The API calls to SFMC can use the MID of the Business Unit to target a different BU than the one that was used to create the Installed Package.
This is, when you want to provide your MID on the initial setup or to change it in the ssjs-setup.json
file.
To develop:
Asset provider can deploy any file automatically or by SSJS: Upload Script to Dev
command (Content Builder folder is set on first file deployment).
Since v0.1.2
, the file has to be initially deployed by Upload Script
command before auto-deploy will work. You wouldn’t want to spam Content Builder with any file you create, right?
Server provider needs to be on by running SSJS: Start
and stopped by SSJS: Stop
command.
How to run your script?
- Open your published Cloud Page / Text resource. One is all you need for your scripts.
- Run
SSJS: Get Dev PATH
on your script file - this puts the query parameters into clipboard. Then just add them to the Cloud Page URL! ENTER it and you’re done! Since0.3.7
this will give you the whole URL!
Dev Pages
SSJS Manager currently offers two ways of running your code - in a Cloud Page and in Text resources. However, as of v0.3.7 you can use both at the same time!
Also, you can secure these pages as you see fit. The extension will install the pages with security of your choosing. Currently you can pick either token (either in URL or in HTTP Headers) or basic auth. Both will remember your login for up to 1 day!
You could also choose not to use those. But why decrease your security?
There are other options coming, but no spoilers!