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
terminal
Loading...
TS
App.tsx
Loading...

✨ 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.js
Loading...

🏗️ Framework Examples with React

Next.js (App Router)

TY
layout.tsx
Loading...

Next.js with Custom Chat

TY
page.tsx
Loading...

💡 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:

  1. Install @emblemvault/emblem-auth-react and @emblemvault/hustle-react
  2. Wrap your app with EmblemAuthProvider
  3. Replace HustleIncognitoClient with HustleProvider
  4. Use ConnectButton for user authentication
  5. Remove API key environment variables