Skip to main content

Overview

OpenSight integrates with several third-party services to provide authentication, payments, notifications, and AI capabilities. All integrations are configured via environment variables.

Authentication

OpenSight supports multiple authentication methods configured in apps/api/src/config/passport.ts.

GitHub OAuth

Allow users to sign in with their GitHub account. Configuration (.env.example:7-8):
OAuth Flow:
  1. User clicks “Sign in with GitHub”
  2. Redirects to GET /auth/github
  3. GitHub callback to GET /auth/github/callback
  4. User created or linked in database
Implementation (apps/api/src/config/passport.ts:130-152):
GitHub OAuth emails are automatically verified. Users authenticated via GitHub have email_verified: true.

Google OAuth

Allow users to sign in with their Google account. Configuration (.env.example:9-10):
OAuth Flow:
  1. User clicks “Sign in with Google”
  2. Redirects to GET /auth/google (scopes: profile, email)
  3. Google callback to GET /auth/google/callback
  4. User created or linked in database
Token-based Flow: For mobile/SPA apps, use the token endpoint:
Implementation (apps/api/src/config/passport.ts:152-170):
Google OAuth implementation uses the google-auth-library package for token verification in the /auth/google/token endpoint.

Local Authentication

Traditional email/password authentication using Passport Local Strategy. Configuration (.env.example:5-6):
User Model (packages/shared/src/types/user.ts):
JWT secrets must be at least 32 characters in production. Use a cryptographically secure random string generator.

Payment Processing

Stripe

Stripe handles all subscription billing and payment processing. Configuration (.env.example:12-17):
Stripe Client (apps/api/src/config/stripe.ts):
Webhook Handler (apps/api/src/routes/webhook.routes.ts):
Handles Stripe events:
  • customer.subscription.created
  • customer.subscription.updated
  • customer.subscription.deleted
  • invoice.payment_succeeded
  • invoice.payment_failed
Stripe webhooks must be configured in your Stripe Dashboard to point to https://your-domain.com/api/webhooks/stripe
User Subscription Data: Each user has Stripe fields:
  • stripe_customer_id: Stripe Customer ID
  • stripe_subscription_id: Active subscription ID
  • plan_id: Current plan (free, starter, growth)

Email Services

Resend

Resend powers all transactional emails. Configuration (.env.example:19-21):
Email Functions (apps/api/src/config/email.ts):
Email Types:
  1. Verification Email: Sent on user registration
  2. Password Reset: Sent when user requests password reset
  3. Alert Digest: Weekly/daily notification summaries
Email alerts are sent based on user plan and notification preferences. See Plans & Pricing for details.

Caching & Job Queue

Upstash Redis

Upstash provides HTTP-based Redis for caching and rate limiting. Configuration (.env.example:23-25):
Redis Client (apps/api/src/config/redis.ts):
Job Processing: OpenSight includes a simple in-process job runner:
This replaces BullMQ for simple, single-server deployments. Redis is used via HTTP REST API instead of TCP connections.

AI Engine APIs

OpenSight integrates with multiple AI engines for visibility tracking.

OpenAI

Configuration (.env.example:27-28):
Used for:
  • ChatGPT visibility tracking
  • Content analysis
  • Prompt evaluation

Perplexity

Configuration (.env.example:29):
Used for:
  • Perplexity AI visibility tracking
  • Answer analysis
Configuration (.env.example:30):
Used for:
  • Google AI Overviews tracking
  • SERP analysis
  • Competitor monitoring

ChatGPT

Available on all plans

Perplexity

Starter and Growth plans

Google AIO

Starter and Growth plans

File Uploads

UploadThing

Configuration (.env.example:32-34):
Used for:
  • Brand logo uploads
  • User avatar uploads
  • Report attachments

Error Tracking

Sentry (Optional)

Configuration (.env.example:36-38):
Sentry is optional but recommended for production deployments. It provides error tracking and performance monitoring.

Webhooks

Users on the Growth plan can configure custom webhooks for real-time notifications. Webhook Configuration (apps/api/src/services/notification.service.ts):
Webhook Delivery (apps/api/src/jobs/alert-checker.ts):
Webhook Events:
  • Visibility drops
  • New competitor mentions
  • Sentiment shifts
  • New brand mentions
Webhooks are only available on the Growth plan. See Plans & Pricing for upgrade options.

Feature Flags

Configuration (.env.example:40-42):
Feature flags allow you to toggle features without code changes:
  • ENABLE_CONTENT_SCORING: Enable/disable content scoring API
  • ENABLE_WEBHOOKS: Enable/disable webhook notifications

Environment Variables Summary

Plans & Pricing

View integration availability by subscription tier

Admin Panel

Manage platform integrations from admin dashboard