Narval | Docs
GithubHome
  • Narval Connect
    • Overview
    • Getting Started
  • Security Overview
  • Providers
    • Providers
      • Anchorage
      • BitGo
      • Coinbase Prime
      • Fireblocks
      • HexTrust
  • Guide
    • ConnectClient
    • Connect Widget
      • initiateConnect
      • completeConnect
    • Using a Connection
      • listWallets
      • getWalletById
      • listAccounts
      • getAccountById
      • listAddresses
      • getAddressById
      • listKnownDestinations
      • sendTransfer
      • getTransfer
      • EVM Transactions
        • sendTransaction
        • getTransactionById
        • signMessage
        • getSignMessageById
        • signTypedData
        • getTypedDataById
      • Staking
        • Ethereum (ETH)
        • Polygon (POL)
        • Solana (SOL)
        • Sui (SUI)
      • Raw Signing
        • signRaw
        • getRawSignRequest
    • Manage Connections
      • listConnections
      • getConnection
      • revokeConnection
  • API Reference
    • REST API
      • Authorization
      • Connect Widget
      • Networks & Assets
      • Wallets, Accounts, Addresses
      • Known Destinations
      • Transfer
      • Stake
        • Ethereum
        • Polygon
        • Solana
        • Sui
      • Transactions
        • Ethereum (EVM)
      • Raw Signing
      • Transit Encryption Key
      • Manage Connections
Powered by GitBook
On this page
  1. Guide
  2. Connect Widget

initiateConnect

See Getting Started for a full overview of the Connect Widget flow.

connectClient.initiateConnect(params) ⇒ 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

Param
Type
Description

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
PreviousConnect WidgetNextcompleteConnect

Last updated 19 days ago