I tried looking in the documentation but can’t seem to find it.
I want to disable some code when running under v0, initially the workos integration, but there may be others later on. I trued setting an environment variable USING_V0=true inside of v0, but then it was added to my vercel project.
I’m at a loss at what I can do, I’d like to keep the environment of the vercel project separate, or at least is there a way to tell the code is under v0, and I can check that instead of using my hacky environment variable.
Here’s what I’m doing now (in one of a few places) - any advice is appreciated. Thanks!!
const isV0Preview = process.env.USING_V0 === "true"const hasWorkOSConfig = process.env.WORKOS_CLIENT_ID && process.env.WORKOS_API_KEY && process.env.WORKOS_COOKIE_PASSWORD// Skip authentication in v0 preview or when WorkOS is not configuredif (isV0Preview || !hasWorkOSConfig) { console.log("[v0] Skipping WorkOS auth middleware - not configured") return NextResponse.next()}