Skip to main content
Users can sign in with a wallet and then link additional providers (Google, Twitter, email) to the same account.

How It Works

When a user is already authenticated (has a valid JWT), calling authStart with a different provider will link the new provider to their existing account instead of creating a new one.
// User is already signed in with SIWE
console.log(client.isAuthenticated); // true
console.log(client.user.id);        // "user-123"

// Start Google OAuth — the existing Bearer token tells the API to link accounts
const { url } = await client.authStart({
  provider: "google",
  redirectUrl: "https://yourapp.com/auth/callback",
});

// Redirect to Google
window.location.href = url;

// After callback + code exchange, the same user now has both identities:
const profile = await client.getCurrentUser();
console.log(profile.identities);
// [
//   { provider: "wallet", providerAccountId: "0xABC..." },
//   { provider: "google", providerAccountId: "google-user-id", proxyWallet: null }
// ]

Auto-Linking by Email

If a user signs in with Google (which has a verified email) and another account already exists with that email (e.g., from a magic link sign-in), the accounts are automatically linked. No extra steps needed.

Viewing Linked Identities

const profile = await client.getCurrentUser();
// GET /users/me

profile.identities.forEach((identity) => {
  console.log(`${identity.provider}: ${identity.providerAccountId}`);
});