connect()
Othent JS SDK connect() function
Prompts the user to sign in/up (connects the user's wallet) using Auth0's popup.
Note that while connect()
's function signature is identical to that of ArConnect's connect()
, you don't need to request permissions from the user to interact with their wallets, as Othent implicitly requires all permissions.
Caution: Users using Othent are giving dApps that use Othent full control of their wallet.
This function will throw an error in the following cases:
When passing
permissions
different toundefined
and the default value (all permissions). Passing anything else will throw an error.When this function is called before the user interacts with the page (e.g. by clicking on a button), as that will result in a
Unable to open a popup
error.When the user closes the Auth0 popup before authenticating, as that will result in a
Popup closed
error.When authentication fails.
API
permissions?: PermissionType[]
permissions?: PermissionType[]
An array of permission to request from the user, but only undefined
or an array with all permissions are valid. Passing anything else will throw an error.
Caution: Users using Othent are giving dApps that use Othent full control of their wallet.
appInfo?: AppInfo
appInfo?: AppInfo
You must provide your application's name and version, and optionally logo, to the SDK when instantiating it. These values can also be changed when calling connect()
, to make Othent compatible with projects using ArConnect.
gateway?: GatewayConfig
gateway?: GatewayConfig
If your application requires the usage of a special gateway or you want to test with an ArLocal testnet gateway, you'll have to provide some information about it when connecting to Othent's SDK.
You can set this value when instantiating Othent
and also change it when calling connect()
, to make Othent compatible with projects using ArConnect.
return Promise<UserDetails | null>
return Promise<UserDetails | null>
A Promise
with the UserDetails
or null
if the log in modal was closed, could not even be opened or authentication failed.
Example usage
Last updated