A minimal example showing how to use the Echo React SDK with Vite.
- Unauthenticated state: Shows sign-in button when user is not authenticated
- Zero balance state: Shows token purchase component when user has no credits
- Success state: Shows welcome message when user has credits
bun install
bun run devThe entire app is in src/App.tsx - just 70 lines of code demonstrating:
- Setting up
EchoProviderwith configuration - Using
useEchohook to check authentication and balance - Conditionally rendering different UI states
- Using
EchoSignInandEchoTokenscomponents
This shows the complete user journey from sign-up to having a positive balance.