Skip to main content

Overview

Cryptique provides specialized methods for tracking wallet connections in Web3 applications. The SDK automatically detects wallet connections via EIP-6963 and window.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.ethereum or EIP-6963 providers connect
  • Account Changes: When user switches accounts (accountsChanged event)
  • Chain Changes: When user switches networks (chainChanged event)
  • Wallet Type: MetaMask, Coinbase Wallet, WalletConnect, etc.
This data is captured in session data without any code required.

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 call walletAddress():
  1. The address is linked to the current session
  2. If this address exists for another user profile, the profiles are merged via CQ Intelligence
  3. The wallet becomes available for enrichment (if enabled)

Examples


Multiple Wallets

Users can connect multiple wallets. Each call to walletAddress() adds to the user’s wallet collection:
The user profile accumulates all connected wallets. You can see all associated wallets in the Cryptique dashboard under the user’s profile.

Wallet Disconnect Behavior

There is no explicit disconnect method. Disconnection is handled automatically:
  1. SDK listens to accountsChanged events
  2. When accounts become empty (disconnected), session data updates
  3. wallet_connected session field becomes false
  4. 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


Best Practices

Track Connection Events

Handle Multiple Chains

Store Primary Wallet


Identify Users

Link wallets to user identities

Wallet Enrichment

Get on-chain wallet data