Salesforce React.js integration
About
Sample integration project between Salesforce and a React.js application.
This application demonstrates the following concepts:
- using JSforce as a Salesforce client
- authenticating with OAuth 2.0 (login, logout, retrieving session info)
- using the REST API to run a SOQL query
- using the Salesforce Lightning Design System (SLDS) in a web application (all the CSS is provided by SLDS)
Installation
-
Create a Connected App in Salesforce.
-
Create a
.env
file in the root directory with this content (make sure to replace the values):domain='https://login.salesforce.com' callbackUrl='http://localhost:8080/auth/callback' consumerKey='YOUR_CLIENT_KEY' consumerSecret='YOUR_CLIENT_SECRET' apiVersion='48.0' isHttps='false' sessionSecretKey='A_SECRET_STRING'
-
Run
npm run build
to build the app. -
Run
npm start
to start the app.