initiateConnect
See Getting Started for a full overview of the Connect Widget flow.
connectClient.initiateConnect(params) ⇒ Promise.<GrantResponseDto>
Promise.<GrantResponseDto>
Initiates a Connect widget instance
Kind: instance method of ConnectClient
Returns: Promise.<GrantResponseDto>
- Grant response from the authentication service
Throws:
ArmorySdkException
If there's an error initiating the connection
params
object
Parameters for initiating the Connect flow
params.label
string
Label for the access token
params.capabilities
Array.<string>
List of capabilities to use with this Connect instance, required
params.networks
Array.<string>
List of networks to use with this Connect instance, optional
params.providers
Array.<string>
List of providers to restrict the Connect options, optional
[params.userId]
string
Optional internal app user identifier, for reference only
params.finish.uri
string
Finish parameters for the connection
[params.finish.nonce]
string
Finish nonce for verifying at the end of the flow
Example
const data = await connectClient.initiateConnect({
label: `DEV - ${userId} connect token`,
userId: 'app-internal-user-id',
capabilities: ["read_accounts", "evm", "transfer", "staking"],
networks: ["ETHEREUM"],
finish: {
uri: `my-local-app/${crypto.randomUUID()}`,
nonce: crypto.randomUUID()
}
});
// use data.interact.redirect to load the Widget iFrame in a browser
Last updated