Skip to main content
Wallet message signing (SIWE) is in Authentication & sessions and Quickstart: REST. Privy sign-in is Privy Wallet Provider. This page is the other provider calls, the React auth UI, and React Native token storage. Linking another provider onto a user who is already signed in is Account linking. Attaching your own user id is Partner External ID Linking.

Google, X, Apple, and email

These four calls use client.authStart. Google, X, and Apple return type: "redirect" and require redirectUrl (an allowed origin). Email sends a magic link; email is required and redirectUrl is where the link sends the user back. Email and wallet starts can return type: "challenge_required". Resubmit the same body with turnstileToken. Google, X, and Apple do not return that type. Widget setup is Bot protection.
Start authentication. AGG then redirects to redirectUrl with a one-time code. Exchange it on your backend, or in the browser on that page. The code is single-use.
Complete redirect sign-in.

SIWS

Solana wallet sign-in does not redirect. Ledger uses this same call: signMessage on the raw UTF-8 bytes, not Phantom’s signIn() helper.
Start authentication. Verify sign-in.

React

AggAuthProvider from @agg-build/auth completes challenge_required for the connect button. See Bot protection and the Connect Button reference. Wire the client in Quickstart: React.
createTwitterAuthMethod and createAppleAuthMethod are the same shape as createGoogleAuthMethod.

Dedicated callback pages

On a standalone callback route, useAggAuthCallback() reads the redirect:
useAggAuth is the wallet hook for a custom button.

Token storage

Access and refresh tokens stay in memory. The SDK writes only a non-sensitive hint to localStorage (user id, username, avatar, wallet address, and wasAuthenticated), keyed by appId. Restoring that hint sets authStatus to "unknown", not "authenticated". persistSession: false skips the hint. Refresh lifetimes are in Authentication & sessions. In "cookie-refresh", those methods may omit refreshToken from the JSON.

React Native

localStorage is missing, so the hint is not stored and isAuthenticated is false after a restart. The HttpOnly cookie is not available either. Keep "body" mode, store the refresh token in the platform keystore, and seed it with setSession() before the first authenticated call.
Do not put the refresh token in AsyncStorage.

Install

Install wagmi only for Ethereum, and the Solana packages only for SIWS.

Authentication

Sessions, refresh, and SIWE.

Quickstart: REST

Wallet sign-in with curl.

Bot protection

Turnstile when start returns challenge_required.

Privy

Sign in with a Privy access token.

Account linking

Add a provider to the current user.

Quickstart: React

Client, provider, and connect button setup.