Overview
Cryptique provides specialized methods for tracking wallet connections in Web3 applications. The SDK automatically detects wallet connections via EIP-6963 andwindow.ethereum, but you can also manually trigger wallet tracking.
When a wallet connects, Cryptique automatically links the wallet address to the current session and user profile. This enables unified analytics across off-chain behavior and on-chain transactions.
Automatic Wallet Detection
Cryptique automatically detects:- Wallet Connection: When
window.ethereumor EIP-6963 providers connect - Account Changes: When user switches accounts (
accountsChangedevent) - Chain Changes: When user switches networks (
chainChangedevent) - Wallet Type: MetaMask, Coinbase Wallet, WalletConnect, etc.
Cryptique.walletAddress()
Associate a wallet address with the current user. Use this when you have the wallet address from your connection flow.string
required
The wallet address to associate with the current user (e.g.,
0x742d35Cc6634C0532925a3b844Bc9e7595f5bB21).Returns
void
How It Works
When you callwalletAddress():
- The address is linked to the current session
- If this address exists for another user profile, the profiles are merged via CQ Intelligence
- The wallet becomes available for enrichment (if enabled)
Examples
Multiple Wallets
Users can connect multiple wallets. Each call towalletAddress() adds to the user’s wallet collection:
Wallet Disconnect Behavior
There is no explicit disconnect method. Disconnection is handled automatically:- SDK listens to
accountsChangedevents - When accounts become empty (disconnected), session data updates
wallet_connectedsession field becomesfalse- Last wallet data is retained for the session
Combining with identify()
You can use wallet address as the user’s identity:Session Data Fields
When a wallet is connected, these fields are captured in session data:Integration Examples
- wagmi + React
- ethers.js
- Web3Modal
Best Practices
Track Connection Events
Handle Multiple Chains
Store Primary Wallet
Related Methods
Identify Users
Link wallets to user identities
Wallet Enrichment
Get on-chain wallet data