Skip to content

Configuration Schema

Complete reference for config.json.

Root Schema

typescript
interface ApiConfig {
  supabase?: SupabaseConfig;
  firebase?: FirebaseConfig;
  sqlite?: SQLiteConfig;
  databaseProvider?: 'supabase' | 'firebase' | 'sqlite';
  jwt?: JWTConfig;
  routes: RouteConfig[];
  credentials?: CredentialsConfig;
  cache?: CacheConfig;
  rateLimit?: RateLimitConfig;
  agent?: AgentConfig;
  rbac?: RBACConfig;
  analytics?: AnalyticsConfig;
  webhooks?: WebhookConfig[];
  customIntegrations?: CustomIntegration[];
  pagination?: PaginationConfig;
  r2?: R2Config;
  storageProvider?: 'supabase' | 'r2' | 'both';
}

Database Configs

Supabase

typescript
interface SupabaseConfig {
  url: string;      // Project URL
  anonKey: string;  // Anonymous key
}

Firebase

typescript
interface FirebaseConfig {
  projectId: string;
  clientEmail: string;
  privateKey: string;
}

SQLite

typescript
interface SQLiteConfig {
  dbPath: string;  // Path to database file
}

JWT Config

typescript
interface JWTConfig {
  secret: string;
  expiresIn?: number;  // Seconds (default: 3600)
}

Credentials Config

typescript
interface CredentialsConfig {
  stripe?: {
    secretKey: string;
  };
  jira?: {
    baseUrl: string;
    email: string;
    apiToken: string;
  };
  github?: {
    token: string;
  };
  sendgrid?: {
    apiKey: string;
  };
  slack?: {
    webhookUrl: string;
  };
  twilio?: {
    accountSid: string;
    authToken: string;
    fromNumber: string;
  };
  polar?: {
    accessToken: string;
  };
}

Cache Config

typescript
interface CacheConfig {
  enabled: boolean;
  provider: 'memory' | 'redis' | 'sqlite';
  ttl?: number;           // Default TTL in seconds
  maxSize?: number;       // Max cached items
  maxMemoryMB?: number;   // Memory limit (memory provider)
  redis?: {
    url: string;
  };
  sqlite?: {
    dbPath: string;
  };
}

Rate Limit Config

typescript
interface RateLimitConfig {
  enabled: boolean;
  default?: {
    windowMs: number;
    max: number;
    message?: string;
    statusCode?: number;
    skipSuccessfulRequests?: boolean;
    skipFailedRequests?: boolean;
  };
  perEndpoint?: Record<string, RateLimitOptions>;
}

Agent Config

typescript
interface AgentConfig {
  enabled: boolean;
  embedding?: {
    provider: 'openai' | 'lmstudio';
    model: string;
    apiKey?: string;
    baseUrl?: string;
  };
  vectorStore?: {
    provider: 'qdrant';
    url: string;
    apiKey?: string;
    collection: string;
  };
  llm?: {
    provider: 'openai' | 'anthropic' | 'google' | 'lmstudio';
    model: string;
    apiKey?: string;
    baseUrl?: string;
  };
  mcpServers?: MCPServerConfig[];
}

RBAC Config

typescript
interface RBACConfig {
  enabled: boolean;
  defaultRole?: string;
  rolesTable?: string;
  permissionsTable?: string;
  userRolesTable?: string;
}

R2 Storage Config

typescript
interface R2Config {
  accountId: string;
  accessKeyId: string;
  secretAccessKey: string;
  bucket: string;
  publicUrl?: string;
}

Pagination Config

typescript
interface PaginationConfig {
  defaultLimit?: number;    // Default: 20
  maxLimit?: number;        // Default: 100
  defaultOffset?: number;   // Default: 0
}

Analytics Config

typescript
interface AnalyticsConfig {
  enabled: boolean;
  excludePaths?: string[];
  serviceName?: string;
  buffer?: {
    enabled: boolean;
    flushInterval?: number;
    maxSize?: number;
  };
}

Released under the ISC License.