For Developers: All demos are hosted in the global-accounts app. To test locally, run
pnpm dev in the global-accounts directory and access demos at http://localhost:5173/demos.Interactive Demo
Experience B3 authentication in action with all available providers:This is a live, interactive demo using the actual B3 SDK. When you don’t specify
strategies, all available authentication options are displayed. View the full demo page for more examples.Authentication Strategies
B3 Global Accounts support multiple authentication strategies to fit your application’s needs.Social Login
Google Authentication
Discord Authentication
Multiple Specific Strategies
You can allow users to choose from multiple specific authentication providers:Specify an array of strategies to show only those authentication options to your users.
Headless Authentication
For custom implementations, use the headless authentication service:Basic Authentication
React Native Authentication
Authentication Hooks
useB3 Hook
The primary hook for accessing authentication state:The
useB3 hook provides access to the authenticated account (wallet account) and user (user profile data). Use useAuthStore to access loading and authentication states.useAccountWallet Hook
Access wallet information and connection status:Error Handling
Implement proper error handling for authentication flows:Best Practices
Partner ID
Always use your unique partner ID for proper attribution and analytics.
Error Handling
Implement comprehensive error handling for better user experience.
Session Management
Set appropriate session durations based on your application’s security needs.
Environment Config
Use proper environment variables for different deployment stages.
Component API Reference
SignInWithB3
The main authentication button component.Props
Array of authentication strategies to display. Options include:
"google", "discord", "x", "apple", "walletConnect", "io.metamask", "com.coinbase.wallet".Leave undefined to show all options.Blockchain chain configuration object with
id, name, nativeCurrency, and rpc.Your unique partner ID for B3 Global Accounts.
Callback function called when authentication succeeds.
Async callback function called when an error occurs.
Whether to close the modal after successful login.
Custom text or component for the sign-in button.
Whether to show the B3 logo in the button.
Available Authentication Strategies
B3 Global Accounts supports the following authentication methods:| Strategy | Type | Description |
|---|---|---|
"google" | Social | Google OAuth authentication |
"discord" | Social | Discord OAuth authentication |
"x" | Social | X (formerly Twitter) authentication |
"apple" | Social | Apple Sign In |
"guest" | Passwordless | Guest authentication without signup |
"walletConnect" | Wallet | WalletConnect protocol |
"io.metamask" | Wallet | MetaMask browser extension |
"com.coinbase.wallet" | Wallet | Coinbase Wallet |
HypeDuel