Authentication - Agent Hustle
Agent Hustle integrates seamlessly with Emblem Auth for secure, wallet-based authentication. For web applications, use the React components for the best user experience.
🎯 React (Recommended)
BA
terminalLoading...
TS
App.tsxLoading...
✨ Benefits:
- • Wallet-based authentication (more secure than API keys)
- • Ready-to-use UI components
- • Automatic JWT token management
- • Works with EVM, Solana, and Hedera wallets
- • OAuth support (Twitter, Google)
🔑 API Key Authentication (Deprecated)
⚠️ Deprecation Notice
API key authentication is deprecated and will be removed in a future version. Please migrate to the React component approach using @emblemvault/emblem-auth-react for better security and user experience.
Using embedded API keys in client-side code is a security risk. The React auth approach uses secure wallet-based authentication instead.
JA
basic-auth-deprecated.jsLoading...
🏗️ Framework Examples with React
Next.js (App Router)
TY
layout.tsxLoading...
Next.js with Custom Chat
TY
page.tsxLoading...
💡 Best Practices
- • Use React components for web applications instead of API keys
- • Wrap with EmblemAuthProvider for automatic auth integration
- • Let users connect wallets for better security and ownership
- • Use the widget for site-wide chat experiences
- • Enable settings to let users customize model and prompts
✅ Migration from API Keys
If you're currently using API key authentication:
- Install
@emblemvault/emblem-auth-reactand@emblemvault/hustle-react - Wrap your app with
EmblemAuthProvider - Replace
HustleIncognitoClientwithHustleProvider - Use
ConnectButtonfor user authentication - Remove API key environment variables