Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit b8413ba Sep 25, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist initital commit Sep 20, 2018
src initital commit Sep 20, 2018
.gitignore initital commit Sep 20, 2018
README.md Update README.md Sep 24, 2018
app.json initital commit Sep 20, 2018
package-lock.json initital commit Sep 20, 2018
package.json initital commit Sep 20, 2018
server.js initital commit Sep 20, 2018
webpack.config.js initital commit Sep 20, 2018

README.md

Sample block with authentication

Sample Salesforce Marketing Cloud Content Builder Block using the blocksdk and SSO OAuth.

Deployment

As a node app

npm install
npm start

One click deployment to heroku:

Deploy

Environment variables

The node app needs the following env variables set:

  • APP_ID - the app ID or installed package ID so it knows what SSO page to send to
  • APP_SIGNATURE - the app signature or JWT signing secret so it can decode the JWT passed by SSO
  • CLIENT_ID - the client id from the API integration so it can use the auth endpoing to get a token
  • CLIENT_SECRET - the client secret from the API integration so it can use the auth endpoing to get a token

Building your own block from here

# do not fork
git clone https://github.com/tbesluau/sampleblock.git <my block name e.g. myblock>
cd <my block name e.g. mybock>
# create your own empty github repository for your new block and copy the clone url for it
git remote set-url origin <your empty repo url>
npm install

Files to edit:

  • src/main.js for your code
  • dist/index.html for your markup
  • package.json for your block name and description
  • README.md to be your own README

To test your changes locally:

npm run build; npm start

Then go to the block tester app and enter http://localhost:3000 in the text field and click a block. You will have to allow unsecure iframes in your bowser (top right in the url bar in Chrome) first.

Once ready to deploy, commit your changes to your repo and click the deploy to heroku button on it.

You can’t perform that action at this time.