Newer Version Available

This content describes an older version of this product. View Latest

Create the App

In this step, you’ll create both the Heroku “hello world” app and the associated canvas app in your Salesforce organization.

  1. In Salesforce, from Setup, click Canvas App Previewer.
  2. Click Heroku Quick Start.
  3. In the Template field, select Java – Quick Start Template.
  4. In the Canvas App Name field, enter a unique name of up to 30 characters.
  5. In the Heroku App Name field, enter a unique name of up to 30 characters that begins with a letter and contains only lowercase letters, numbers, and dashes. The newappName must be unique across all Heroku apps. This name becomes part of the URL for your app, for example, newappName.herokuapp.com.
  6. In the Auth Type field, select Username/Password.
  7. In the Heroku Username field, enter the username for the account used to log in to Heroku. This is typically an email address. The Heroku app is created under this user’s credentials.

    This field has a maximum length of 30 characters. If your Heroku username is longer than 30 characters, you’ll need to use the API key associated with your account. You can find this value on the Heroku My Account page.

    Note

  8. In the Heroku Password field, enter the password for the account used to log in to Heroku.

    Instead of using the username and password for the Heroku account, you can use the account’s associated API key. You can find this value on the Heroku Account page. Alternatively, you can use Heroku OAuth which initiates the Heroku OAuth flow or, if you’re currently logged in to Heroku, uses the Heroku token.

    Tip

  9. Click Create. The app displays in the left navigation pane.

    If you see an error like “Error [Read timed out] executing POST to Heroku clone REST service,” this means the operation has timed out trying to contact Heroku. You can check the status of Heroku at http://status.heroku.com.

  10. Click the link to your new app on the left.

    The app appears and you’ll see the message Hello User.FullName, as well as other information about the current user.

You just created a canvas app—congratulations! You’ll only be able to see your canvas app in the Canvas App Previewer until you set the locations where it can appear by following the steps in Set the App Location. This defines where a user sees your app after it’s installed in their organization.

Behind the scenes, the Heroku Quick Start sets the canvas app’s Permitted Users, which includes admin-approved users and your profile. For example, if your user profile is System Administrator, that profile is added to the canvas app you just created, and any users with that profile can access the canvas app.