How It Works
Every provider follows the same pattern:- Call
authStartwith the provider name - User authenticates (signs a message, clicks an OAuth link, or clicks a magic link in their email)
- Tokens are delivered to your app
| Provider | Step 2 |
|---|---|
| SIWE | User signs a message in their wallet. Tokens returned directly from verify. |
| Google / Twitter | User is redirected to the provider’s login page. After approval, AGG redirects back to your app with tokens in the URL hash fragment. |
| User receives a magic link via email. After clicking, AGG redirects to your app with tokens in the URL hash fragment. |
SIWE (Wallet)
SIWE is fully client-side — no redirects:OAuth & Magic Link (Google, Twitter, Email)
These three providers all use the same redirect-based flow. Pass the page you want the user to land on after sign-in asredirectUrl — typically your dashboard or home page:
- Google
- Twitter
- Email
redirectUrl with tokens in the URL hash fragment:
Reading Tokens from the Hash
On any page that could be a redirect target, check for tokens in the hash on load:Using React Hooks
With@agg-market/hooks, the SIWE flow is handled automatically:
Token Storage
The SDK automatically stores tokens inlocalStorage (keyed by appId) and restores them on construction.