Skip to main content

Overview

Cryptique automatically assigns anonymous IDs to track users. When you know who a user is (e.g., after login or wallet connection), use identify() to link their anonymous activity to their known identity.
Cryptique’s CQ Intelligence merge engine automatically consolidates user profiles across sessions, devices, and wallets when you call identify().

Cryptique.identify()

Associate the current user with a unique identifier.

Parameters

string
required
A unique identifier for the user. This could be:
  • User ID from your database
  • Email address
  • Wallet address
  • Any unique string that identifies this user
Maximum length: 255 characters

Returns

void

Basic Usage


When to Call identify()

1

After Login

When a user logs into your application:
2

After Signup

When a new user creates an account:
3

On Page Load (Returning Users)

When a logged-in user returns:

Cross-Domain Identification

Cryptique can merge user profiles across domains when you use the same identifyId:

Cryptique.reset()

Clear the current user identity and start a new anonymous session. Use this when a user logs out.

Returns

void

Usage

Always call reset() when a user logs out. Without this, the next user on the same device could be associated with the previous user’s data.

Wallet Address as Identity

You can use wallet addresses as the primary identifier:
Using wallet addresses as identifiers works well for Web3 apps where users may not have traditional accounts. The same user with multiple wallets will have separate profiles unless you link them with a common identifier.

Identity Merge Behavior

When you call identify():
  1. New User: If the identifyId hasn’t been seen before, the current anonymous profile is converted to an identified profile.
  2. Existing User, Same Device: If the identifyId matches a profile already on this device, sessions merge seamlessly.
  3. Existing User, New Device: If the identifyId exists from another device, Cryptique’s CQ Intelligence merges the profiles automatically.
  4. Group memberships: When the server returns group_memberships for this user, the SDK restores them locally so group assignments stay in sync across devices.

Best Practices

Use Persistent IDs

Don’t Over-Identify

Handle Auth State Changes


Complete Authentication Flow


User Properties

Set persistent user attributes

Groups

Company and team associations

Wallet Methods

Track wallet connections