SMS OTP authentication integration with Authsignal and Crossmint wallet creation.
- User enters phone number
- Sends SMS code via Authsignal + Bird
- User enters code
- Creates/retrieves Crossmint wallet on successful authentication
- Shows wallet address and USDC balance
- Create account at Authsignal
- Get your credentials:
- Tenant ID
- Base URL
- Secret Key
- Create account at Bird
- Add a US phone number
- Get Bird credentials
- In Authsignal dashboard, integrate Bird SMS with these required roles:
Reach Email Admin
Channels API Client
← Most important
Create .env.local
:
# Authsignal Server (server)
AUTHSIGNAL_SECRET_KEY=your_secret_key_here
# Authsignal Client (public)
NEXT_PUBLIC_AUTHSIGNAL_TENANT_ID=your_tenant_id_here
NEXT_PUBLIC_AUTHSIGNAL_BASE_URL=https://api.authsignal.com/v1
# Crossmint API Key (server)
CROSSMINT_API_KEY=your_api_key_here
pnpm install
pnpm dev
Open http://localhost:3000
- Phone Input → User enters phone number
- Server → Creates token via Authsignal API
- SMS → Authsignal + Bird send SMS code
- Code Input → User enters 6-digit code
- Success → Creates/retrieves Crossmint wallet and shows balance
- 403 Forbidden: Check Bird roles (need
Channels API Client
) - SMS not sending: Verify Bird integration in Authsignal dashboard
- Token errors: Check environment variables
app/
├── components/sms-auth.tsx ← Main component
├── lib/authsignal-client.ts ← Client utilities
├── api/auth/init/route.ts ← Get token
├── api/auth/validate/route.ts ← Validate token
└── lib/authsignal-server.ts ← Server client