prevision / apps /prevision-api /src /config /app-config.interface.ts
github-actions[bot]
Automated Deploy: 23110475c742a5d4f03930b55bca09042215c1dd
1fe7075
Raw History Blame Contribute Delete
1.25 kB
export type Environment = 'development' | 'test' | 'staging' | 'production';
export interface AppConfig {
environment: Environment;
port: number;
databaseUrl: string;
allowedOrigins: string[];
allowedOriginRegex: RegExp | null;
clerk: {
/** One per Clerk instance the API accepts, e.g. production and development. */
secretKeys: string[];
jwtKey?: string;
};
processingToken: {
secret: string;
ttlSeconds: number;
audience: string;
issuer: string;
};
internalTokenAudience: string;
/** Lifetime free generations for accounts without a subscription. */
freeGenerations: number;
/** The Prevision site, for Stripe's success, cancel and portal return links. */
appUrl: string;
stripe: StripeConfig;
}
export type PlanId = 'starter' | 'growth';
export interface StripeConfig {
secretKey: string;
webhookSecret: string;
/** Stripe Price id and monthly generation allowance of each plan. */
plans: Record<PlanId, { priceId: string; monthlyGenerations: number }>;
/** Public URL of the logo shown on Stripe Checkout. Optional. */
logoUrl?: string;
/** The branded billing portal configuration (bpc_...). Optional: Stripe's default otherwise. */
portalConfigurationId?: string;
}