useConnector
The useConnector()
hook provides variables and methods to simplify handling connections with both custodial clients and wallets. It offers the following methods and variables:
UseConnector methods
connect()
connect()
This method connects accounts using custodial clients (e.g., email, Google, Facebook, TikTok, and X ) and wallets (MetaMask, WalletConnect, Coinbase Wallet, and Xaman). It required one parameter:
connector.id
: ID of the connector.
Example:
connectAndSignIn()
connectAndSignIn()
The method attempts to connect a wallet client and directly sign into Auth. It accepts two parameters:
connector.id
: ID of the connector.flow
: Flow is an optional parameter and it can beredirect
orpopup
. It defaults toredirect
.
Example:
disconnect()
disconnect()
This method disconnects accounts from custodial clients and wallets. It accepts one optional parameter.
connector.id
: ID of the connector.
Example:
isConnected
isConnected
Boolean to perform conditional validations for connections.
Example:
connector
connector
Object containing data of the connector used for the connection.
Example:
isConnecting
isConnecting
A boolean value indicating whether the connection process is still ongoing (true
if connecting, false
when the connection is complete). This is useful for managing UI states.
connectors
connectors
Array of available connectors for both wallet providers and custodial clients supported by Pass:
Custodial Clients
Email
Google
Facebook
X (former Twitter)
TikTok
Wallets
MetaMask
WalletConnect
Coinbase Wallet
Xaman
Example:
Last updated