This demo is built with the Lightning Web Runtime and demonstrates the use of the Pub/Sub API with Change Data Capture events and Platform Events.
🎥 Watch a short introduction video.
Warning
This demo app does not use the most secure authentication mechanism. We recommend using an OAuth 2.0 JWT Bearer Flow for production environments.
You can either install the app on
- Heroku (quick deployment for demo purposes)
- your local machine (prefered for development purposes)
Click on this button and follow the instructions to deploy the app:
Once deployed, see the configuration reference section for configuring the environment variables.
-
Create a
.env
file at the root of theebikes-manufacturing
projectSALESFORCE_AUTH_TYPE="user-supplied" SALESFORCE_LOGIN_URL="https://test.salesforce.com" SALESFORCE_API_VERSION="56.0" SALESFORCE_USERNAME="YOUR_SALESFORCE_USERNAME" SALESFORCE_PASSWORD="YOUR_SALESFORCE_PASSWORD" SALESFORCE_TOKEN="YOUR_SALESFORCE_SECURITY_TOKEN" PUB_SUB_ENDPOINT="api.pubsub.salesforce.com:7443"
-
Update the property values by referring to the configuration reference section
-
Install the project with
npm install
-
Run the project with
npm start
All variables are required.
Variable | Description | Example |
---|---|---|
SALESFORCE_AUTH_TYPE |
The Salesforce authentication type for the Pub/Sub API client. Do not change this value. | user-supplied |
SALESFORCE_LOGIN_URL |
The login URL of your Salesforce org:https://test.salesforce.com/ for scratch orgs and sandboxeshttps://login.salesforce.com/ for Developer Edition and production |
https://test.salesforce.com |
SALESFORCE_API_VERSION |
The Salesforce API version. | 56.0 |
SALESFORCE_USERNAME |
Your Salesforce user's password. | n/a |
SALESFORCE_PASSWORD |
Your Salesforce username. | n/a |
SALESFORCE_TOKEN |
Your Salesforce user's security token. | n/a |
PUB_SUB_ENDPOINT |
The endpoint used by the Pub/Sub API. | api.pubsub.salesforce.com:7443 |