window.paragon
, and/or the Paragon REST API..authenticate
should be called at the beginning of your application's lifecycle in all cases. This is to make sure that the userToken
is always as fresh as possible, with respect to your user's existing session on your own site..authenticate
has been called, you can access the user's integration state with .getUser()
. .authenticate()
only needs to be called when using the Paragon SDK - when making requests to the Paragon REST API, you should instead provide the Paragon User Token in the Authorization header..connect
to launch your Connect Portal for a specific integration provider. You can find the integrationType
identifier you need in the Overview page for the integration.integrationType
for the Portal to appear. Otherwise, this function does nothing..getIntegrationMetadata
to get the name
, brandColor
, and icon
, for any of your integration providers. This is a great way to create your integrations page!.getUser
to retrieve the currently authenticated user and their connected integration state.{ authenticated: false }
instead. Please check the authenticated
property before using the user.integrations
field..subscribe
to subscribe to different events and changes from the Paragon SDK. You can find the possible eventNames
below:.subscribe()
.connect()
"onIntegrationInstall"
"onInstall"
"onIntegrationUninstall"
"onUninstall"
"onWorkflowChange"
"onWorkflowChange"
"onPortalOpen"
"onOpen"
"onPortalClose"
"onClose"
.connect()
only applies to a currently open Connect Portal locally.onOpen
, onClose
, onUninstall
, and onWorkflowChange
as a one-time event locally..request
to send an API request to a third-party integration on behalf of one of your users.paragon.request
, which takes three arguments:integrationType
: The short name for the integration. i.e. "salesforce" or "googleCalendar". You can find this string on the Overview tab of the integration you want to access, on your Paragon dashboard.path
: The path (without the hostname) of the API request you are trying to access. An example might be: "/v1/charges" for Stripe's charge API or "chat.postMessage" for Slack's Web API.requestOptions
: Request options to include, such as:body
: An object representing JSON contents of the request.method
: An HTTP verb such as "GET" or "POST". Defaults to GET..workflow()
to trigger a Paragon workflow that sends a custom response back to your app..configs
) and the Workflows associated with each integration (as .workflows
)