Skip to main content
Read flags on the request path — no expiry needed, so use the KV binding (env.MY_KV) directly.
import { env } from "@telnyx/edge-runtime";

export async function handler(request: Request): Promise<Response> {
    const newUiEnabled = await env.MY_KV.get("flag/new-ui");

    // Swap in whatever each branch should serve.
    return newUiEnabled === "true"
        ? new Response("new UI")
        : new Response("old UI");
}
Flip a flag without redeploying — from the CLI:
telnyx-edge storage kv key put <namespace-id> flag/new-ui true