[null, null, {"document_url": "https://auth0.com/blog/extend-salesforce-with-node/", "unformatted_src": "https://cdn.auth0.com/website/blog/profiles/bobbyjohnson.png", "src": "https://cdn.auth0.com/website/blog/profiles/bobbyjohnson.png", "formatted_filename": "bobbyjohnson", "rendered_width": 27, "rendered_height": 27}, null, {"document_url": "https://auth0.com/blog/extend-salesforce-with-node/", "unformatted_src": "https://cdn.auth0.com/auth0-extend/assets/extend-salesforce-screen-2.jpg", "src": "https://cdn.auth0.com/auth0-extend/assets/extend-salesforce-screen-2.jpg", "formatted_filename": "extend salesforce screen", "alt_text": "Screen"}, null, null, null, null, null]
Extend Salesforce with Node.js 
tl;dr: Extend for Salesforce lets you implement triggers in Node 8 with full access to 400k NPM modules. Check it out auth0.com/extend/salesforce.

Salesforce is a powerful and mature SaaS CRM platform that developers can customize to meet their organization's business needs. For instance, you can author custom triggers which attach to the lifecycle of Salesforce objects. One catch, you need to learn Apex. If you are a NodeJS/Javascript developer, who has never worked with Apex, this can be a big jump. You need to move to a new language and ecosystem. That is until now.

We want to enable NodeJS developers to harness the power of the Salesforce platform using the language and ecosystem they already know.

Extend for Salesforce Today we are announcing the public beta of Extend for Salesforce. You can now implement triggers in Node v8 and you can leverage any of the more than 400K modules in the NPM ecosystem. Best of all you can do this right from the browser. With Extend for Salesforce, your team can quickly and easily customize your Salesforce logic using a language many modern programmers already use.

Want to notify your employees every time a big deal closes? You can quickly create a Node trigger on the Opportunity object so that when it closes, a notification is sent to Slack.

Wouldn't it be nice if every time you added a lead in Salesforce, it was also added to your Marketo campaigns? Add a trigger on the lead object, pull in the marketo-rest-api module, and use it to send the lead along.

Extend for Salesforce is built on Auth0 Extend, our extensibility as a service platform. It can let your customers create extensions to your SaaS quickly and easily. Sign up for our free developer account here.

Take It for a Spin

Let's walk through a simple use case for sending a Slack notification to the team whenever a new lead is created. First, you need to create an Incoming Webhook in Slack. Head over to Extend for Salesforce and log in, if you have not done so already. Follow these steps.

You should now see the Extend Editor. Click the double headed arrow icon in the lower left-hand corner of the editor to give you some room to work. Secrets are a secure storage feature of Extend for Salesforce. The values are encrypted while stored and decrypted only for execution. Let's hide your Slack Webhook URL there. You will be using the slack-notify NPM module to send messages to Slack. You will need to add it as a dependency. We have added some helpful comments to get you started. However, for now, add the following code and click the Save button.

This code uses the slack-notify NPM module that was previously added, to send a message to the #general channel in Slack with the username Salesforce. Within your trigger you can use the context object to access secrets like the Slack Webhook url. This code uses ctx.secrets.slack_url to initialize the Slack object.

That is all there is to it. Go add a new lead in Salesforce and watch a notification magically sent to Slack. This is just a basic message, you can make it much fancier. Take a look here for details on customizing messages for Slack.


With Extend for Salesforce you have a new way to write triggers, using Node.js! Go try it out here. We cannot wait to see what you will create with it! Over the coming months, we will be working diligently to add new features based on your feedback.

If your organization is interested in using Extend for Salesforce or you have a tip/suggestion, let us know via the Talk to Sales link.

Note: Special thanks to James Ward from Salesforce for his Salesforce Webhook Creator which provided inspiration for the approach we used for creating Extend for Salesforce.

Extend for Salesforce with Node 8
