Branchwell

Lumen & Gesso / website · lumengesso.com / app / lib / free-studio-checkout.ts

1import 'server-only';
2import { getCloudflareContext } from '@opennextjs/cloudflare';
3
4/** Default off while Studio replaces the legacy paid commission funnel.
5 * This never controls access to an existing order, support, or refunds. */
6export function physicalCheckoutEnabled(): boolean {
7 let flag: string | undefined;
8 try {
9 flag = (getCloudflareContext().env as { LUMEN_PHYSICAL_CHECKOUT_ENABLED?: string })
10 .LUMEN_PHYSICAL_CHECKOUT_ENABLED;
11 } catch {
12 // The binding isn't present in a standalone Next server/test.
13 }
14 return (flag ?? process.env.LUMEN_PHYSICAL_CHECKOUT_ENABLED) === 'true';
15}
16
17export const physicalCheckoutPausedMessage =
18 'New physical orders are paused. Digital image creation is free in Studio.';