Learn how to handle multiple wallet addresses per user using Snag’s user group feature for seamless multi-wallet support
In Snag, each wallet address represents an individual user. To support users with multiple wallets, we provide a User Group feature that allows you to connect multiple wallet addresses together, treating them as a single user across your loyalty system.
Multiple Wallets: Users often have wallets on different chains (Ethereum, Polygon, Solana, etc.)
Shared Identity: All wallets in a group share the same social accounts and metadata
Unified Loyalty: Points, badges, and rewards are tracked across all wallets in the group
Seamless Experience: Users don’t need to reconnect social accounts for each wallet
Enable User Groups First: Before using the user group feature, you must enable it in your Snag dashboard. Navigate to Customisation → User Profiles and enable multiple wallet connections. If this feature is not enabled, the POST /api/users/connect endpoint will return an error: “This website does not support multiple wallet connections, please contact support”.
import SnagSolutions from '@snagsolutions/sdk'const client = new SnagSolutions({ apiKey: 'your-api-key-here',})// Connect a user to a groupconst response = await client.users.connect({ organizationId: '123e4567-e89b-12d3-a456-426614174001', walletAddress: '0x1234567890abcdef1234567890abcdef12345678', walletType: 'evm', websiteId: '123e4567-e89b-12d3-a456-426614174000',})console.log('User connected to group:', response.id)
// Disconnect a user from a groupconst response = await client.users.disconnect({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', userId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', websiteId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',})console.log('User disconnected:', response.message)
When a user/wallet address is connected to a group, all user metadata including social handles gets synced across all users in that group:
Copy
Ask AI
// Example: User has wallets on Ethereum and Polygonconst ethereumWallet = '0x1234567890abcdef1234567890abcdef12345678'const polygonWallet = '0xabcdef1234567890abcdef1234567890abcdef12'// Connect both wallets to the same groupawait client.users.connect({ organizationId: 'your-org-id', walletAddress: ethereumWallet, walletType: 'evm', websiteId: 'your-website-id',})await client.users.connect({ organizationId: 'your-org-id', walletAddress: polygonWallet, walletType: 'evm', websiteId: 'your-website-id',})// Now both wallets share the same social accounts and metadata
Group Management: Create user groups based on your application’s needs - typically one group per user identity.
Wallet Types: Always specify the correct wallet type when connecting users to ensure proper chain support.
Metadata Updates: When updating user metadata, the changes will automatically sync across all wallets in the group.
Disconnection Impact: When disconnecting a wallet from a group, the wallet becomes a standalone user and loses access to shared metadata and loyalty benefits.