diff --git a/apps/api/src/lib/auth.ts b/apps/api/src/lib/auth.ts index 7be66cc..241e962 100644 --- a/apps/api/src/lib/auth.ts +++ b/apps/api/src/lib/auth.ts @@ -25,8 +25,8 @@ export const useAuth: ( const options = { trustedOrigins: [env.FE_APP_URL], - baseURL: env.BETTER_AUTH_URL, - secret: env.BETTER_AUTH_SECRET, + baseURL: env.INFISCAL_BETTER_AUTH_URL, + secret: env.INFISCAL_BETTER_AUTH_SECRET, database: drizzleAdapter(db, { provider: 'pg', schema }), ...betterAuthConfig, // anything that needs db below this line diff --git a/apps/api/src/partykit/internal/AI.service.ts b/apps/api/src/partykit/internal/AI.service.ts index d53b976..3ffab3e 100644 --- a/apps/api/src/partykit/internal/AI.service.ts +++ b/apps/api/src/partykit/internal/AI.service.ts @@ -69,7 +69,7 @@ Be encouraging but thorough in your evaluation. Focus on understanding their tho this.room = room; this.client = new OpenAI({ - apiKey: this.env.OPENROUTER_API_KEY, + apiKey: this.env.INFISCAL_OPENROUTER_API_KEY, baseURL: 'https://openrouter.ai/api/v1', }); } @@ -341,7 +341,7 @@ User's question: ${userMessage.content} private getDb() { if (!this.db) { - const sql = postgres(this.env.DATABASE_URL); + const sql = postgres(this.env.INFISCAL_DATABASE_URL); this.db = drizzle(sql); } diff --git a/apps/api/src/partykit/privateRoom.do.ts b/apps/api/src/partykit/privateRoom.do.ts index 2b85013..21afb74 100644 --- a/apps/api/src/partykit/privateRoom.do.ts +++ b/apps/api/src/partykit/privateRoom.do.ts @@ -95,7 +95,7 @@ export class PrivateRoomServer extends YServer { private getDb() { if (!this.db) { - const sql = postgres(this.env.DATABASE_URL); + const sql = postgres(this.env.INFISCAL_DATABASE_URL); this.db = drizzle(sql); } diff --git a/apps/api/src/partykit/room.do.ts b/apps/api/src/partykit/room.do.ts index 85f634e..3df2298 100644 --- a/apps/api/src/partykit/room.do.ts +++ b/apps/api/src/partykit/room.do.ts @@ -193,7 +193,7 @@ export class RoomServer extends YServer { private getDb() { if (!this.db) { - const sql = postgres(this.env.DATABASE_URL); + const sql = postgres(this.env.INFISCAL_DATABASE_URL); this.db = drizzle(sql); } diff --git a/apps/api/src/services/third-party/Loops.service.ts b/apps/api/src/services/third-party/Loops.service.ts index 3b33b40..ebc82d8 100644 --- a/apps/api/src/services/third-party/Loops.service.ts +++ b/apps/api/src/services/third-party/Loops.service.ts @@ -33,7 +33,7 @@ export class LoopsService { private client: LoopsClient; constructor(private readonly ctx: Context) { - this.client = new LoopsClient(this.ctx.env.LOOPS_API_KEY); + this.client = new LoopsClient(this.ctx.env.INFISCAL_LOOPS_API_KEY); } async createContact(params: { email: string; name: string }) { diff --git a/apps/api/src/services/third-party/Stripe.service.ts b/apps/api/src/services/third-party/Stripe.service.ts index 2b05873..ea37475 100644 --- a/apps/api/src/services/third-party/Stripe.service.ts +++ b/apps/api/src/services/third-party/Stripe.service.ts @@ -3,12 +3,12 @@ import { Context } from 'hono'; import { Stripe } from 'stripe'; import { AppContext } from '@/index'; -const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY; +const STRIPE_SECRET_KEY = process.env.INFISCAL_STRIPE_SECRET_KEY; if (!STRIPE_SECRET_KEY) { throw new Error('STRIPE_SECRET_KEY is not set'); } -const STRIPE_WEBHOOK_SECRET = process.env.STRIPE_WEBHOOK_SECRET; +const STRIPE_WEBHOOK_SECRET = process.env.INFISCAL_STRIPE_WEBHOOK_SECRET; if (!STRIPE_WEBHOOK_SECRET) { throw new Error('STRIPE_WEBHOOK_SECRET is not set'); } diff --git a/apps/api/worker-configuration.d.ts b/apps/api/worker-configuration.d.ts index b0aa21f..28a38db 100644 --- a/apps/api/worker-configuration.d.ts +++ b/apps/api/worker-configuration.d.ts @@ -1,24 +1,24 @@ /* eslint-disable */ -// Generated by Wrangler by running `wrangler types` (hash: f871f0bb7812599a823fbf1908f4876c) +// Generated by Wrangler by running `wrangler types` (hash: 006b55bf04295474ed35860d23be26ae) // Runtime types generated with workerd@1.20250617.0 2025-06-01 nodejs_compat,nodejs_compat_populate_process_env declare namespace Cloudflare { interface Env { ASSETS_URL: "https://assets.coderscreen.com"; NODE_ENV: string; FE_APP_URL: string; - BETTER_AUTH_URL: string; FREE_PLAN_ID: string; - STRIPE_PUBLISHABLE_KEY: string; - STRIPE_SECRET_KEY: string; - STRIPE_WEBHOOK_SECRET: string; - DATABASE_URL: string; - LOOPS_API_KEY: string; - OPENROUTER_API_KEY: string; - BETTER_AUTH_SECRET: string; - GOOGLE_CLIENT_ID: string; - GOOGLE_CLIENT_SECRET: string; - GITHUB_CLIENT_ID: string; - GITHUB_CLIENT_SECRET: string; + INFISCAL_STRIPE_PUBLISHABLE_KEY: string; + INFISCAL_STRIPE_SECRET_KEY: string; + INFISCAL_STRIPE_WEBHOOK_SECRET: string; + INFISCAL_DATABASE_URL: string; + INFISCAL_LOOPS_API_KEY: string; + INFISCAL_OPENROUTER_API_KEY: string; + INFISCAL_BETTER_AUTH_URL: string; + INFISCAL_BETTER_AUTH_SECRET: string; + INFISCAL_GOOGLE_CLIENT_ID: string; + INFISCAL_GOOGLE_CLIENT_SECRET: string; + INFISCAL_GITHUB_CLIENT_ID: string; + INFISCAL_GITHUB_CLIENT_SECRET: string; SANDBOX: DurableObjectNamespace; Room: DurableObjectNamespace; PrivateRoom: DurableObjectNamespace; @@ -32,7 +32,7 @@ type StringifyValues> = { [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string; }; declare namespace NodeJS { - interface ProcessEnv extends StringifyValues> {} + interface ProcessEnv extends StringifyValues> {} } // Begin runtime types diff --git a/apps/api/wrangler.jsonc b/apps/api/wrangler.jsonc index 695e47c..4463691 100644 --- a/apps/api/wrangler.jsonc +++ b/apps/api/wrangler.jsonc @@ -23,9 +23,8 @@ "vars": { "NODE_ENV": "production", "FE_APP_URL": "https://app.coderscreen.com", - "FREE_PLAN_ID": "free", - "BETTER_AUTH_URL": "https://api.coderscreen.com/auth", "ASSETS_URL": "https://assets.coderscreen.com", + "FREE_PLAN_ID": "free", }, "containers": [ {