Third-Party Services Setup Guide for Sasha Studio
Purpose: Step-by-step setup instructions for all external services required by Sasha Studio
Priority: Complete these setups BEFORE starting development to avoid integration delays
Quick Start Checklist
Essential Services (Set up immediately)
- Supabase - Database & Authentication
- Anthropic - Primary AI Service
- Domain Name - Professional deployment
- GitHub - Source control with secrets
Core Services (Set up within first week)
- Stripe - Payment processing
- SendGrid/SES - Email delivery
- Docker Hub - Container registry
- Cloudflare - CDN & Security
Enhancement Services (Set up within second week)
- OpenAI - Alternative AI models
- Sentry - Error monitoring
- Google Analytics - Usage tracking
- OpenRouter - Multi-model API access
Service Setup Instructions
ποΈ Supabase (Database & Authentication)
Purpose: PostgreSQL database + Authentication + Real-time subscriptions
Cost: Free tier available, $25/month Pro
Dependencies: None - Start here first
Getting Started
Create Project
- Go to https://supabase.com and click "Start your project"
- Sign up with GitHub for easy integration
- Create new project:
- Choose a strong database password (save it securely!)
- Select region closest to your users
- Wait for project provisioning (~2 minutes)
Get Your Credentials
- Go to Settings β API
- Copy these values (you'll need them):
- Project URL
anonpublic keyservice_rolekey (keep this secret!)
Configure Authentication
- Go to Authentication β Providers
- Enable Email/Password authentication
- Customize email templates:
- Go to Authentication β Email Templates
- Update branding and copy for your app
Set Up Database Schema
- Go to SQL Editor
- Run your initial schema migrations
- Set up Row Level Security policies
Environment Variables:
SUPABASE_URL=https://[PROJECT_REF].supabase.co
SUPABASE_ANON_KEY=eyJ0eXAiOiJKV1QiLCJhbGc...
SUPABASE_SERVICE_ROLE_KEY=eyJ0eXAiOiJKV1QiLCJhbGc...
Testing: Verify connection with a simple query in the SQL Editor
Anthropic (Claude AI)
Purpose: Primary AI model for chat responses
Cost: Usage-based, approximately $15 per million tokens
Dependencies: None
Getting Started
Create Account
- Go to https://console.anthropic.com
- Create account with your business email
- Complete business verification if required
Set Up Billing
- Add payment method (required for API access)
- Set monthly spend limit ($100 recommended to start)
- Enable usage alerts
Generate API Key
- Go to API Keys section
- Click "Create Key"
- Add descriptive name: "Sasha Studio Production"
- Copy the key immediately (shown only once!)
- Store securely in your password manager
Test Integration
- Use the Anthropic Console to test API calls
- Verify your key works with a simple request
Environment Variables:
ANTHROPIC_API_KEY=sk-ant-api03-[your-key-here]
Rate Limits: 5 requests/minute on free tier, higher with paid plan
OpenAI (GPT Models)
Purpose: Alternative AI models and fallback system
Cost: Usage-based, approximately $20 per million tokens
Dependencies: None
Getting Started
Create Account
- Go to https://platform.openai.com
- Sign up or log in with existing account
- Complete phone verification
Configure Billing
- Go to Billing β Payment methods
- Add credit card for API access
- Set usage limits:
- Soft limit: $50/month
- Hard limit: $100/month
Generate API Key
- Go to API keys
- Click "Create new secret key"
- Name it "Sasha Studio"
- Save the key securely!
Test API Access
- Use OpenAI Playground to verify access
- Try a simple GPT-3.5 or GPT-4 request
Environment Variables:
OPENAI_API_KEY=sk-[your-key-here]
Best Practices: Monitor usage daily, enable spending alerts
Stripe (Payment Processing)
Purpose: Subscription billing and license management
Cost: 2.9% + $0.30 per successful transaction
Dependencies: Business verification may take 1-2 days
Getting Started
Create Account
- Go to https://stripe.com
- Sign up with business information
- Complete identity verification (required for live payments)
Business Setup
- Add business details, tax ID
- Upload required documentation
- Set up bank account for payouts
Get API Keys
- Go to Developers β API keys
- Copy both Publishable and Secret keys
- Start with Test keys for development
Configure Webhooks
- Go to Developers β Webhooks
- Add endpoint:
https://yourdomain.com/api/webhooks/stripe - Select events:
customer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failed
- Copy the webhook signing secret
Create Subscription Products
- Go to Products
- Create subscription tiers:
- Starter: $29/month
- Pro: $99/month
- Enterprise: $299/month
- Set up usage-based pricing if needed
Environment Variables:
# Test keys for development
STRIPE_SECRET_KEY=sk_test_[your-test-key]
STRIPE_PUBLISHABLE_KEY=pk_test_[your-test-key]
STRIPE_WEBHOOK_SECRET=whsec_[your-webhook-secret]
# Live keys for production (add separately)
STRIPE_LIVE_SECRET_KEY=sk_live_[your-live-key]
STRIPE_LIVE_PUBLISHABLE_KEY=pk_live_[your-live-key]
Testing: Use Stripe CLI to test webhooks locally
SendGrid (Email Service)
Purpose: Transactional emails (password reset, notifications, welcome emails)
Cost: Free tier (100 emails/day), $14.95/month for 50K emails
Dependencies: Domain verification recommended
Getting Started
Create Account
- Go to https://sendgrid.com
- Sign up for free account
- Complete email verification
Authenticate Your Domain (Recommended)
- Go to Settings β Sender Authentication
- Choose "Domain Authentication"
- Enter your domain name
- Add provided DNS records to your domain
- Verify authentication (may take up to 48 hours)
Create API Key
- Go to Settings β API Keys
- Click "Create API Key"
- Choose "Restricted Access"
- Enable only "Mail Send" permission
- Save the key securely!
Create Email Templates
- Go to Email API β Dynamic Templates
- Create templates for:
- Welcome email
- Password reset
- Subscription notifications
- Usage alerts
Configure IP Warmup (if needed)
- For high-volume sending, warm up your IP
- Start with low volumes and gradually increase
Environment Variables:
SENDGRID_API_KEY=SG.[your-api-key]
SENDGRID_FROM_EMAIL=noreply@yourdomain.com
SENDGRID_FROM_NAME=Sasha Studio
Alternative: Amazon SES (more complex setup but potentially lower cost)
Domain & DNS Configuration
Purpose: Professional domain name for your application
Cost: $10-15/year for domain registration
Dependencies: None, but affects other services
Getting Started
Choose Domain
- Brainstorm domain names related to your brand
- Check availability at multiple registrars
- Consider
.com,.ai,.iofor tech products
Register Domain
- Recommended registrars:
- Namecheap (good prices, easy interface)
- Google Domains (integrates with Google services)
- Cloudflare Registrar (at-cost pricing)
- Enable domain privacy protection
- Set up auto-renewal
- Recommended registrars:
DNS Configuration (if using Cloudflare)
- Create Cloudflare account (see next section)
- Add your domain to Cloudflare
- Update nameservers at your registrar
- Wait for propagation (up to 24 hours)
Domain Suggestions:
sasha-studio.comyourbrand-ai.comcompany-sasha.io
Cloudflare (CDN & Security)
Purpose: Performance optimization, DDoS protection, SSL management
Cost: Free tier sufficient for most use cases
Dependencies: Domain registration
Getting Started
Create Account
- Go to https://cloudflare.com
- Sign up with business email
- Verify email address
Add Your Domain
- Click "Add a Site"
- Enter your domain name
- Choose Free plan (upgrade later if needed)
- Cloudflare scans existing DNS records
Update Nameservers
- Cloudflare provides new nameservers
- Log into your domain registrar
- Replace existing nameservers with Cloudflare's
- Wait for activation (usually 5-10 minutes)
Configure Security Settings
- SSL/TLS β "Full (strict)" mode
- Always Use HTTPS β On
- Security Level β High
- Bot Fight Mode β On
Set Up DNS Records
- A record:
@β your server IP address - CNAME record:
wwwβ@ - TXT records for email verification
- A record:
Enable Additional Features
- Browser Cache TTL β 4 hours
- Auto Minify β CSS, HTML, JS
- Brotli compression β On
Environment Variables: (if using API)
CLOUDFLARE_API_TOKEN=[your-api-token]
CLOUDFLARE_ZONE_ID=[your-zone-id]
Docker Hub (Container Registry)
Purpose: Store and distribute Docker container images
Cost: Free for public repositories, $5/month for private
Dependencies: Docker installed locally
Getting Started
Create Account
- Go to https://hub.docker.com
- Sign up with your GitHub account (recommended)
- Verify email address
Create Repository
- Click "Create Repository"
- Repository name:
sasha-studio - Visibility: Private (recommended)
- Description: "Sasha Studio AI Knowledge Management Platform"
Login from Command Line
docker login # Enter your Docker Hub username and passwordTest Push (when you have a Docker image)
docker tag sasha-studio:latest yourusername/sasha-studio:latest docker push yourusername/sasha-studio:latest
Environment Variables:
DOCKER_HUB_USERNAME=yourusername
DOCKER_HUB_PASSWORD=yourpassword
Alternative: GitHub Container Registry (integrated with GitHub Actions)
Google Analytics
Purpose: Website usage analytics for published sites
Cost: Free (GA4)
Dependencies: Domain setup
Getting Started
Create Account
- Go to https://analytics.google.com
- Sign in with Google account
- Create Analytics account
Set Up Property
- Property name: "Sasha Studio"
- Time zone and currency
- Choose "Web" platform
Create Data Stream
- Stream name: "Sasha Studio Website"
- Website URL: https://yourdomain.com
- Enhanced measurement β On
Get Measurement ID
- Copy the Measurement ID (G-XXXXXXXXXX)
- You'll use this in your frontend code
Configure Goals (optional)
- Set up conversion tracking
- Configure custom events
- Set up audience segments
Environment Variables:
GA_MEASUREMENT_ID=G-XXXXXXXXXX
Implementation: Add Google Analytics script to your HTML templates
Sentry (Error Monitoring)
Purpose: Error tracking, performance monitoring, and alerting
Cost: Free tier (5,000 errors/month, 10,000 performance units)
Dependencies: None
Getting Started
Create Account
- Go to https://sentry.io
- Sign up with GitHub (recommended)
- Choose your organization name
Create Project
- Platform: Node.js
- Project name: "sasha-studio"
- Team: Default
- Alert frequency: Real-time
Get DSN
- Copy the DSN from project settings
- This connects your app to Sentry
Configure Alerts
- Project Settings β Alerts
- Set up email notifications
- Configure issue assignment rules
- Set up Slack integration (optional)
Set Up Performance Monitoring
- Enable performance monitoring
- Set sample rate (10% recommended)
- Configure transaction sampling
Environment Variables:
SENTRY_DSN=https://[key]@[organization].ingest.sentry.io/[project-id]
SENTRY_ENVIRONMENT=production
Integration: Install Sentry SDK in your Node.js application
OpenRouter (Multi-Model API)
Purpose: Access multiple AI models through unified API
Cost: Usage-based with small markup over provider costs
Dependencies: None (optional service)
Getting Started
Create Account
- Go to https://openrouter.ai
- Sign up with email or GitHub
- Verify email address
Add Credits
- Go to Account β Credits
- Add minimum $5 to start
- Set up auto-reload if desired
Generate API Key
- Go to Account β API Keys
- Create new key
- Add description: "Sasha Studio"
- Copy the key securely
Review Models
- Browse available models and pricing
- Test different models in the playground
- Note rate limits for each model
Environment Variables:
OPENROUTER_API_KEY=sk-or-v1-[your-key]
Benefits: Model diversity, cost optimization, unified API
Setup Priority & Timeline
Day 1: Foundation Services
Set up these services immediately to start development:
GitHub Repository
- Create repository
- Set up branch protection
- Configure secrets for CI/CD
Supabase Project
- Database foundation
- Authentication system
- Real-time capabilities
Anthropic API
- Primary AI service
- Test integration
- Set spending limits
Domain Registration
- Professional web presence
- SSL certificate foundation
- Email subdomain setup
Week 1: Core Integration
Add these services for full functionality:
Stripe Setup
- Payment processing
- Subscription management
- Webhook configuration
SendGrid Configuration
- Transactional emails
- Domain authentication
- Template creation
Cloudflare Activation
- DNS management
- CDN and security
- SSL certificates
Docker Hub Repository
- Container image storage
- Automated builds
- Version management
Week 2: Enhancement & Monitoring
Add these services for production readiness:
OpenAI Access
- Model diversity
- Fallback system
- Cost comparison
Sentry Integration
- Error tracking
- Performance monitoring
- Alert configuration
Google Analytics
- Usage tracking
- User behavior insights
- Conversion measurement
OpenRouter Account
- Multi-model access
- Cost optimization
- Model experimentation
Later: Enterprise Features
- SSO Providers (Okta, Auth0)
- Advanced monitoring (DataDog, New Relic)
- Compliance tools (audit logging)
- Backup services (AWS S3, Google Cloud)
Security Best Practices
API Key Management
- Never commit API keys to Git repositories
- Use environment variables for all credentials
- Rotate API keys quarterly or after any security incident
- Monitor API usage for unusual patterns
- Set up usage alerts and spending limits
- Use separate keys for development and production
Service Account Security
- Enable 2FA on all service accounts
- Use unique, strong passwords (password manager recommended)
- Regular access reviews and cleanup of unused keys
- Principle of least privilege for API permissions
- Monitor login activities and set up alerts
Webhook Security
- Always verify webhook signatures
- Use HTTPS endpoints only
- Implement replay attack protection
- Log all webhook events for audit trails
- Set up monitoring for failed webhook delivers
Network Security
- Use HTTPS/TLS for all communications
- Configure proper CORS headers
- Implement rate limiting on all APIs
- Use Cloudflare's DDoS protection
- Monitor for suspicious traffic patterns
Budget Planning & Cost Management
Estimated Monthly Costs (Starting Small)
| Service | Free Tier | Paid Tier | Production Estimate |
|---|---|---|---|
| Supabase | 500MB DB, 2GB bandwidth | $25/month Pro | $25-75 |
| Anthropic | No free tier | Usage-based | $50-200 |
| OpenAI | $5 free credit | Usage-based | $30-150 |
| Stripe | Pay per transaction | 2.9% + $0.30 | Variable |
| SendGrid | 100 emails/day | $14.95/month | $15-50 |
| Domain | N/A | $10-15/year | $1.25 |
| Cloudflare | Free plan | $20/month Pro | $0-20 |
| Docker Hub | 1 private repo | $5/month | $5 |
| Sentry | 5K errors/month | $26/month | $0-26 |
| Google Analytics | Free | Free | $0 |
| OpenRouter | No free tier | Usage-based | $20-100 |
| Total Estimate | $146-622/month |
Cost Optimization Strategies
Start with Free Tiers
- Use free tiers for development and testing
- Upgrade only when you hit limits
- Monitor usage closely
AI Cost Management
- Implement response caching
- Use cheaper models for simple queries
- Set up usage alerts at 80% of budget
- Monitor token usage per user
Email Cost Control
- Use transactional emails only
- Implement email templates
- Avoid marketing emails initially
Monitoring Setup
- Set up billing alerts on all services
- Review costs weekly
- Use usage dashboards
- Set hard spending limits where possible
Budget Alerts Configuration
Set up spending alerts at these thresholds:
- Warning: 50% of monthly budget
- Critical: 80% of monthly budget
- Emergency: 95% of monthly budget
Testing & Validation
Service Integration Testing
After setting up each service, verify integration:
Database (Supabase)
# Test database connection
curl -X GET '[YOUR_SUPABASE_URL]/rest/v1/' \
-H "apikey: [YOUR_ANON_KEY]"
AI Services (Anthropic)
# Test API access
curl -X POST 'https://api.anthropic.com/v1/messages' \
-H 'x-api-key: [YOUR_API_KEY]' \
-H 'anthropic-version: 2023-06-01' \
-H 'content-type: application/json' \
-d '{"model":"claude-3-haiku-20240307","max_tokens":100,"messages":[{"role":"user","content":"Hello"}]}'
Email Service (SendGrid)
# Test email sending
curl -X POST 'https://api.sendgrid.com/v3/mail/send' \
-H 'Authorization: Bearer [YOUR_API_KEY]' \
-H 'Content-Type: application/json' \
-d '{"personalizations":[{"to":[{"email":"test@example.com"}]}],"from":{"email":"noreply@yourdomain.com"},"subject":"Test","content":[{"type":"text/plain","value":"Test email"}]}'
Environment Configuration Test
Create a test script to verify all environment variables:
// test-env.js
const requiredEnvVars = [
'SUPABASE_URL',
'SUPABASE_ANON_KEY',
'SUPABASE_SERVICE_ROLE_KEY',
'ANTHROPIC_API_KEY',
'STRIPE_SECRET_KEY',
'SENDGRID_API_KEY'
];
requiredEnvVars.forEach(varName => {
if (!process.env[varName]) {
console.error(`β Missing required environment variable: ${varName}`);
} else {
console.log(`β
${varName} is configured`);
}
});
π Support & Troubleshooting
Common Issues & Solutions
Supabase Connection Issues
- Problem: Database connection timeout
- Solution: Check region settings and firewall rules
- Support: https://supabase.com/docs
AI API Rate Limits
- Problem: 429 Too Many Requests
- Solution: Implement exponential backoff and request queuing
- Support: Check provider documentation for rate limits
Email Delivery Issues
- Problem: Emails going to spam
- Solution: Complete domain authentication and warm up IP
- Support: SendGrid support team
Stripe Webhook Failures
- Problem: Webhook signature verification failing
- Solution: Verify endpoint URL and webhook secret
- Support: Stripe webhook debugger
Support Resources
| Service | Documentation | Support | Status Page |
|---|---|---|---|
| Supabase | https://supabase.com/docs | Discord/GitHub | https://status.supabase.com |
| Anthropic | https://docs.anthropic.com | Email support | https://status.anthropic.com |
| OpenAI | https://platform.openai.com/docs | Community forum | https://status.openai.com |
| Stripe | https://stripe.com/docs | Chat/email | https://status.stripe.com |
| SendGrid | https://docs.sendgrid.com | Email/phone | https://status.sendgrid.com |
| Cloudflare | https://developers.cloudflare.com | Community/support | https://cloudflarestatus.com |
Final Checklist
Before starting development, ensure you have:
Credentials Secured
- All API keys stored in password manager
- Environment variables documented
- Backup access methods configured
- Team access shared securely
Services Tested
- Database connection verified
- AI API calls working
- Email sending functional
- Payment processing tested
- Domain/DNS resolved correctly
Monitoring Configured
- Spending alerts set up
- Usage monitoring enabled
- Error tracking configured
- Service status monitoring
Documentation Updated
- Environment variable list current
- Setup instructions documented
- Team onboarding guide created
- Emergency contact info available
Next Steps: With all services configured, you're ready to begin Sasha Studio development. Start with the foundation features from the Comprehensive Feature List and reference the JWT Authentication Flow Guide for implementation details.