Global Accounts Introduction

B3 Global Accounts provide seamless authentication and user management across the B3 ecosystem

What are B3 Global Accounts?

B3 Global Accounts are a unified authentication system that provides users with a single identity across the entire B3 ecosystem. Users can authenticate once and access all B3 applications, games, and services seamlessly.

Key Features

Social Login

Support for Google, Discord, and other social authentication providers.

Session Management

Secure session key authentication with customizable permissions.

Cross-Platform

Works across web, mobile, and desktop applications.

Developer Friendly

Simple React components and headless TypeScript services.

Architecture

The Global Accounts system consists of several key components:

Authentication Flow

  1. Social Login: Users authenticate with their preferred social provider
  2. Account Creation: A B3 Global Account is created or linked
  3. Session Keys: Optional session keys for enhanced security
  4. Permissions: Granular permissions for different actions

React Components

  • B3Provider: Context provider for Global Accounts
  • SignInWithB3: Complete authentication flow
  • RequestPermissionsButton: Permission management
  • AccountAssets: Display user assets

Headless Services

  • Authentication service for custom implementations
  • Session management utilities
  • Permission validation helpers

Quick Start

Basic Authentication

tsx
import { B3Provider, SignInWithB3 } from "@b3dotfun/sdk/global-account/react"; function App() { return ( <B3Provider environment="production" partnerId="your-awesome-partner-id"> <SignInWithB3 provider={{ strategy: "google" }} partnerId="your-partner-id" onLoginSuccess={(globalAccount) => { console.log("User authenticated:", globalAccount); }} /> </B3Provider> ); }

Check Authentication Status

tsx
import { useB3 } from "@b3dotfun/sdk/global-account/react"; function UserProfile() { const { account, isAuthenticated } = useB3(); return ( <div> {isAuthenticated ? ( <p>Welcome, {account?.displayName}!</p> ) : ( <p>Please sign in</p> )} </div> ); }

Environment Configuration

Set up your environment variables:

bash
# Production NEXT_PUBLIC_B3_API=https://api.b3.fun NEXT_PUBLIC_BSMNT_API=https://api.basement.fun # Development NEXT_PUBLIC_B3_API=https://dev-api.b3.fun NEXT_PUBLIC_BSMNT_API=https://dev-api.basement.fun

Next Steps

Authentication Guide

Learn about different authentication strategies and implementation.

Learn More
Permissions System

Understand session keys and permission management.

Learn More
React Hooks

Explore available hooks for Global Accounts integration.

Learn More
Examples

See complete examples and integration patterns.

Learn More
Ask a question... ⌘I