Overview
Drift requires the following API keys for full functionality:| Service | Purpose | Required | Environment Variable |
|---|---|---|---|
| Nessie | Demo banking data (Capital One sandbox) | Yes (for demo) | NESSIE_API_KEY |
| Plaid | Real bank account connections | Yes (for production) | PLAID_CLIENT_ID, PLAID_SECRET |
| Gemini | Natural language goal parsing & AI insights | Yes | GEMINI_API_KEY |
| ElevenLabs | Voice narration of simulation results | Optional | ELEVENLABS_API_KEY |
All API keys should be stored in a
.env file in the project root. Never commit API keys to version control.Nessie API (Capital One)
Use case: Demo mode with fake banking data for development and testing.Obtaining Your Key
- Visit the Capital One DevExchange
- Sign up for a developer account
- Navigate to the Nessie API section
- Register your application to receive an API key
- Copy your API key from the dashboard
Configuration
Add to your.env file:
Code Reference
The Nessie service is implemented inapps/api/src/services/nessieService.ts:4-7:
Default Demo Customer
Nessie includes a pre-seeded demo customer with comprehensive 12-month financial data:- Customer ID:
697541cf95150878eafea4ff(Alex Morgan) - Includes checking/savings accounts, credit cards, purchases, deposits, bills, and loans
- Used automatically when no customer ID is specified
Plaid API
Use case: Production-ready bank account connectivity with real financial data.Obtaining Your Credentials
- Visit Plaid Dashboard
- Create a free account (sandbox access is free)
- Complete the onboarding questionnaire
- Navigate to Team Settings → Keys
- Copy your
client_idand sandboxsecret
Configuration
Add to your.env file:
Environment Options
| Environment | Description | Cost |
|---|---|---|
| sandbox | Fake data, test credentials | Free |
| development | Real bank connections, limited volume | Free (100 Items) |
| production | Full production access | Pay per item |
Code Reference
The Plaid client is configured inapps/api/src/services/plaidService.ts:14-26:
Sandbox Test Credentials
When using Plaid Link in sandbox mode, use these test credentials:- Username:
user_good - Password:
pass_good - MFA Code:
1234(if prompted)
Products Enabled
Drift requests the following Plaid products:- Transactions (required) - 90 days of transaction history for spending analysis
- Liabilities (optional) - Credit card APRs, loan terms, minimum payments
- Investments (optional) - Holdings and securities for portfolio allocation
apps/api/src/services/plaidService.ts:43-44.
Plaid stores access tokens in memory by default (
plaidService.ts:29). For production, implement persistent storage with encryption (PostgreSQL, Redis, etc.).Google Gemini API
Use case: Natural language goal parsing, AI-generated insights, and conversational advisor.Obtaining Your Key
- Visit Google AI Studio
- Sign in with your Google account
- Click “Get API Key” or “Create API Key”
- Select an existing Google Cloud project or create a new one
- Copy the generated API key
Configuration
Add to your.env file:
Model Used
Drift uses Gemini 2.0 Flash for all AI features:apps/api/src/services/geminiService.ts:19-21.
Features Powered by Gemini
-
Goal Parsing (
parseGoalmethod)- Extracts target amount, timeline, and goal type from natural language
- Example: “Save $50k for a house in 3 years” → structured goal object
- Detects unrealistic inputs and generates clarifying questions
-
Narrative Generation (
generateNarrativemethod)- Creates 3-4 sentence personalized briefings for voice narration
- References specific numbers from user’s financial profile
- Adapts tone based on success probability
-
Recommendations (
generateRecommendationsmethod)- Analyzes simulation results and financial profile
- Generates 3-4 specific, actionable recommendations
- Prioritizes high-impact suggestions
-
Conversational Goal Setting (
GeminiGoalConversationclass)- Interactive goal definition through natural conversation
- Asks clarifying questions one at a time
- Keeps responses to 1-2 sentences for voice compatibility
-
Results Discussion (
GeminiResultsConversationclass)- Chat about simulation results with context awareness
- Explains spending categories and suggests cuts
- Calculates savings from reducing specific categories
Rate Limits
Gemini 2.0 Flash free tier:- 15 requests per minute
- 1,500 requests per day
- 1 million tokens per minute
ElevenLabs API
Use case: Text-to-speech voice narration of simulation results.Obtaining Your Key
- Visit ElevenLabs
- Sign up for an account (free tier available)
- Navigate to Profile → API Keys
- Click “Generate API Key”
- Copy the generated key
Configuration
Add to your.env file:
Available Voices
Drift includes 6 pre-configured voices (apps/api/src/services/elevenLabsService.ts:5-12):
| Voice | Voice ID | Personality | Best For |
|---|---|---|---|
| Josh | TxGEqnHWrfWFTfGW9XjX | Friendly, energetic | Default - good news (≥75% success) |
| Adam | pNInz6obpgDQGcFmaJgB | Deep, authoritative | Moderate odds (50-75% success) |
| Rachel | 21m00Tcm4TlvDq8ikWAM | Warm, professional | General narration |
| Bella | EXAVITQu4vr4xnSDxMaL | Soft, reassuring | Tough situations (below 50% success) |
| Antoni | ErXwobaYiN019PkySvjV | Confident, punchy | Motivational messaging |
| Domi | AZnzlk1XvdvUeBnXmlld | Strong, bold | Assertive advice |
Voice Selection Logic
Drift automatically selects voices based on simulation outcomes (elevenLabsService.ts:186-197):
Audio Generation Settings
Configured inapps/api/src/services/elevenLabsService.ts:52-60:
Features
-
Text-to-Speech (
generateAudiomethod)- Converts narrative text to audio buffer
- Automatically converts numbers to spoken words ($50K → “fifty thousand dollars”)
- Returns audio as MP3 buffer
-
Streaming Audio (
generateAudioStreammethod)- Real-time streaming for faster playback
- Returns Node.js readable stream
-
Speech-to-Text (
transcribeAudiomethod)- Transcribes voice input for conversational goals
- Uses
scribe_v1model - Accepts WebM audio format
Free Tier Limits
- 10,000 characters per month
- 3 custom voices
- Commercial license included
If ElevenLabs API is not configured, the narration feature will be disabled. Users can still view text-based results.
Environment Variables Summary
Complete.env configuration:
Validation
To verify your configuration:Security Best Practices
-
Store keys securely
- Use environment variables or secret management services
- Never hardcode keys in source code
- Rotate keys regularly
-
Limit key permissions
- Use sandbox/development keys for testing
- Restrict production keys to necessary scopes
- Monitor API usage for anomalies
-
Encrypt sensitive data
- Plaid access tokens must be encrypted at rest
- Use AES-256 or equivalent for token storage
- Implement key rotation policies
-
Production deployment
- Use secret management (AWS Secrets Manager, HashiCorp Vault, etc.)
- Set environment variables via hosting platform (Vercel, Railway, etc.)
- Enable API key restrictions (IP allowlists, rate limits)