Configure the Heroku Environment Variables

Now that we’ve created the canvas app, we need to set up an environment variable for the consumer secret.
  1. From Setup, enter Apps in the Quick Find box, then select Apps.
  2. In the Connected Apps related list, click Shipify.
  3. Next to the Consumer Secret field, click the link Click to reveal.
    Canvas app consumer secret
  4. Copy the consumer secret.
  5. Open a command window, navigate to the Shipify-Node-App directory, and enter this command to create the environment variable: heroku config:add APP_SECRET='Your_Consumer_Secret'
    If you’re working from a Windows computer, you may need to replace the single quotes with double quotes (").
  6. Enter this command: heroku config:add RUNNING_ON_HEROKU='true'
    This specifies that the application is running on Heroku. This is helpful for testing so you don’t need to re-deploy every time you make a change. If you’re working from a Windows computer, you may need to replace the single quotes with double quotes (").
  7. Enter this command to deploy the app to Heroku: git push heroku master
    If the process completes successfully, you’ll see something like this:
    1-----> Compiled slug size: 11.2MB
    2-----> Launching... done, v6
    3       http://deep-samurai-7923.herokuapp.com deployed to Heroku
    4
    5To git@heroku.com:deep-samurai-7923.git
    6 * [new branch]      master -> master

    If you receive a “permission denied” error message, you may need to set up your SSH key and add it to Heroku. See https://devcenter.heroku.com/articles/keys.

You can quickly test that the canvas app is working in Salesforce Classic by clicking the Chatter tab. Click the Shipify link in the left column, and you’ll see the Heroku application appear right in Salesforce and display a list of open orders, including the one you created in the previous chapter. Now we’ll add the canvas custom action to the publisher layout so our users can see it.