Use OpenAI, NextJS, and the Auth0-AI SDKs to get Salesforce opportunities
openid
api
refresh_token
offline_access
SALESFORCE_INSTANCE_URL
in your .env
file.auth0.getAccessTokenForConnection()
, pass sfdc
as the connection name to get a Salesforce access token.@ai-sdk/react
hook to wire up the chat component:https://localhost:3000
to see the chat UI:Get me 2 opportunities from Salesforce
, GPT-4 interprets the request and invokes the listOpportunities
tool, which securely calls the Salesforce API using access tokens obtained via Auth0 and returns the results.