Last updated: Aug 12, 2025, 01:09 PM UTC

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

  1. 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)
  2. Get Your Credentials

    • Go to Settings β†’ API
    • Copy these values (you'll need them):
      • Project URL
      • anon public key
      • service_role key (keep this secret!)
  3. 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
  4. 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

  1. Create Account

  2. Set Up Billing

    • Add payment method (required for API access)
    • Set monthly spend limit ($100 recommended to start)
    • Enable usage alerts
  3. 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
  4. 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

  1. Create Account

  2. Configure Billing

    • Go to Billing β†’ Payment methods
    • Add credit card for API access
    • Set usage limits:
      • Soft limit: $50/month
      • Hard limit: $100/month
  3. Generate API Key

    • Go to API keys
    • Click "Create new secret key"
    • Name it "Sasha Studio"
    • Save the key securely!
  4. 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

  1. Create Account

    • Go to https://stripe.com
    • Sign up with business information
    • Complete identity verification (required for live payments)
  2. Business Setup

    • Add business details, tax ID
    • Upload required documentation
    • Set up bank account for payouts
  3. Get API Keys

    • Go to Developers β†’ API keys
    • Copy both Publishable and Secret keys
    • Start with Test keys for development
  4. Configure Webhooks

    • Go to Developers β†’ Webhooks
    • Add endpoint: https://yourdomain.com/api/webhooks/stripe
    • Select events:
      • customer.subscription.created
      • customer.subscription.updated
      • customer.subscription.deleted
      • invoice.payment_succeeded
      • invoice.payment_failed
    • Copy the webhook signing secret
  5. 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

  1. Create Account

  2. 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)
  3. Create API Key

    • Go to Settings β†’ API Keys
    • Click "Create API Key"
    • Choose "Restricted Access"
    • Enable only "Mail Send" permission
    • Save the key securely!
  4. Create Email Templates

    • Go to Email API β†’ Dynamic Templates
    • Create templates for:
      • Welcome email
      • Password reset
      • Subscription notifications
      • Usage alerts
  5. 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

  1. Choose Domain

    • Brainstorm domain names related to your brand
    • Check availability at multiple registrars
    • Consider .com, .ai, .io for tech products
  2. 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
  3. 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.com
  • yourbrand-ai.com
  • company-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

  1. Create Account

  2. Add Your Domain

    • Click "Add a Site"
    • Enter your domain name
    • Choose Free plan (upgrade later if needed)
    • Cloudflare scans existing DNS records
  3. Update Nameservers

    • Cloudflare provides new nameservers
    • Log into your domain registrar
    • Replace existing nameservers with Cloudflare's
    • Wait for activation (usually 5-10 minutes)
  4. Configure Security Settings

    • SSL/TLS β†’ "Full (strict)" mode
    • Always Use HTTPS β†’ On
    • Security Level β†’ High
    • Bot Fight Mode β†’ On
  5. Set Up DNS Records

    • A record: @ β†’ your server IP address
    • CNAME record: www β†’ @
    • TXT records for email verification
  6. 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

  1. Create Account

  2. Create Repository

    • Click "Create Repository"
    • Repository name: sasha-studio
    • Visibility: Private (recommended)
    • Description: "Sasha Studio AI Knowledge Management Platform"
  3. Login from Command Line

    docker login
    # Enter your Docker Hub username and password
    
  4. Test 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

  1. Create Account

  2. Set Up Property

    • Property name: "Sasha Studio"
    • Time zone and currency
    • Choose "Web" platform
  3. Create Data Stream

  4. Get Measurement ID

    • Copy the Measurement ID (G-XXXXXXXXXX)
    • You'll use this in your frontend code
  5. 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

  1. Create Account

    • Go to https://sentry.io
    • Sign up with GitHub (recommended)
    • Choose your organization name
  2. Create Project

    • Platform: Node.js
    • Project name: "sasha-studio"
    • Team: Default
    • Alert frequency: Real-time
  3. Get DSN

    • Copy the DSN from project settings
    • This connects your app to Sentry
  4. Configure Alerts

    • Project Settings β†’ Alerts
    • Set up email notifications
    • Configure issue assignment rules
    • Set up Slack integration (optional)
  5. 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

  1. Create Account

  2. Add Credits

    • Go to Account β†’ Credits
    • Add minimum $5 to start
    • Set up auto-reload if desired
  3. Generate API Key

    • Go to Account β†’ API Keys
    • Create new key
    • Add description: "Sasha Studio"
    • Copy the key securely
  4. 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:

  1. GitHub Repository

    • Create repository
    • Set up branch protection
    • Configure secrets for CI/CD
  2. Supabase Project

    • Database foundation
    • Authentication system
    • Real-time capabilities
  3. Anthropic API

    • Primary AI service
    • Test integration
    • Set spending limits
  4. Domain Registration

    • Professional web presence
    • SSL certificate foundation
    • Email subdomain setup

Week 1: Core Integration

Add these services for full functionality:

  1. Stripe Setup

    • Payment processing
    • Subscription management
    • Webhook configuration
  2. SendGrid Configuration

    • Transactional emails
    • Domain authentication
    • Template creation
  3. Cloudflare Activation

    • DNS management
    • CDN and security
    • SSL certificates
  4. Docker Hub Repository

    • Container image storage
    • Automated builds
    • Version management

Week 2: Enhancement & Monitoring

Add these services for production readiness:

  1. OpenAI Access

    • Model diversity
    • Fallback system
    • Cost comparison
  2. Sentry Integration

    • Error tracking
    • Performance monitoring
    • Alert configuration
  3. Google Analytics

    • Usage tracking
    • User behavior insights
    • Conversion measurement
  4. OpenRouter Account

    • Multi-model access
    • Cost optimization
    • Model experimentation

Later: Enterprise Features

  1. SSO Providers (Okta, Auth0)
  2. Advanced monitoring (DataDog, New Relic)
  3. Compliance tools (audit logging)
  4. 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

  1. Start with Free Tiers

    • Use free tiers for development and testing
    • Upgrade only when you hit limits
    • Monitor usage closely
  2. 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
  3. Email Cost Control

    • Use transactional emails only
    • Implement email templates
    • Avoid marketing emails initially
  4. 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

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.