React Native
Follow this guide to integrate Portal in your app.
Last updated
Follow this guide to integrate Portal in your app.
Last updated
Portal provides MPC wallets and dApp connections for organizations and their users. To integrate Portal, an organization adds a client library to their mobile app and a few server API endpoints.
The basic Portal setup consists of three packages:
@portal-hq/core
- The core Portal library
@portal-hq/keychain
- An adapter for storing MPC signing shares on-device
@portal-hq/gdrive-storage
- An adapter for storing MPC backup shares off-device
These pieces allow you to initialize Portal
in your app.
Follow this guide to gather all of the credentials you need to Authenticate to Portal.
Because these packages have native module dependencies there is some additional linking required to make it work with your React Native project.
Explicitly install the native module packages in your project.
The core Portal library relies on a native module to support MPC behaviors. In order to enable this functionality, you must properly link Portal's MPC client to your React Native project.
To learn more about how to use Portal MPC, see: @portal-hq/core
For more information on how to use the Portal class, see: @portal-hq/core
Now that you've initialized your Portal instance, you can generate a wallet!
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.