To integrate Portal, an organization adds a client library to their web app, configures a
CNAME
record, and adds a few server API endpoints.
Basic setup
The basic Portal setup consists of a single packages:@portal-hq/web
- The core Portal library
Portal
in your app. We recommend only initializing one Portal instance per user.
Authentication
Follow this guide to gather all of the credentials you need to Authenticate to Portal.Installation
Update TSConfig
The Web SDK uses the TSConfiglib
configuration to properly type interaction with the DOM. Update your TSConfig file to include this:
Initializing Portal
We recommend only initializing one Portal instance per user. Do not modify
portal.apiKey
directly.If you are using Client Session Tokens (CSTs), this hint is for you.When your user’s CST expires, all Portal SDKs will throw an error on the next MPC Operation the user makes (e.g. creating a wallet, backing up a wallet, recovering a wallet, or signing). That error will include a code
SESSION_EXPIRED
in the SDK methods, which you can use as an indicator to refresh your CST.