Quickstart
Connect user sessions to your website using Papercuts
Papercuts integration relies on a secure, OAuth-inspired linking mechanism. Lets quickly see how.
1. Generate a linkToken
to initiate integration
Generate a linkToken
from your backend to initiate a integration between your user’s account and Papercuts.
You will need to replace the USER_ID
with your user’s unique identifier, INTEGRATION_NAME
with the integration you want to link to and YOUR_COMPANY_LOGO_URL
with your company logo URL.
You can find the list of supported integrations below.
You can now pass the linkToken
back to your client to initialize the user account integration.
2. Initiate user account integration
Use the linkToken
to open the pre-built pop-up interface to link the user’s account.
- Add the SDK to your project:
- On the client, call the
init
method with thelinkToken
and callbacks to handle success and error.
Once the user has connected their account, the onSuccess
callback will be called with an authToken
. You will need to exchange this authToken
for a userToken
to make requests on behalf of the user.
3. Exchange the short lived authToken
The authToken
is a short-lived token that can be exchanged for a userToken
that can be used to make requests on behalf of the user.
You will need to replace the AUTH_TOKEN
with the authToken
you received in the previous step.
Now the user account is linked and session details are stored securely with Papercuts. You can use the userToken
to make requests on behalf of the user. Same userToken
can be used for all connected integrations.
Next Steps
Overview
Execute actions using authenticated user sessions.