Promote between environments

Resources live in an environment. Promoting dev → prod means creating or syncing those resources in the second environment with a prod API key. This is not a one-click tenant dump.

Prefer Project Glide for server functions, client functions, and TypeScript webhooks. Use replicate REST for API functions and snippets. Copy Vari by hand (never copy secret values). Recreate Jobs, Triggers, Tabi, Auth Providers, GraphQL subscriptions, and Python webhooks until Glide/replicate covers them (roadmap, no date).

You need a prod API key. See Managing Users and API Keys.

Decision tree

  1. Project Glide for server/client functions (and TypeScript webhooks). Point CI secrets at the prod key for a prod sync. Keep a separate workflow or GitHub Environment for dev.

  2. Replicate REST for API functions and snippets. Set includeSchemas: true when the functions need schemas.

  3. Manual Vari with the same context + name, Environment visibility, prod values.

  4. Recreate anything Glide and replicate do not cover yet.

Path A — Project Glide

Mark deployables with polyConfig, run poly prepare / poly sync (or GitHub/GitLab Actions). Full matrix: Supported Resources.

Glide does not copy Vari secrets, Jobs, Triggers, or Tabi today. Those stay on paths C and D.

Path B — Replicate REST

POST selected ids to the destination instance/environment. The destination API key is in the body. Same instance, two envs is the usual case; destinationInstanceUrl can be another instance.

API functions:

POST https://<your-instance>/functions/api/replicate

{
    "destinationInstanceUrl": "https://na1.polyapi.io",
    "destinationEnvironmentId": "YOUR_PROD_ENVIRONMENT_ID",
    "destinationApiKey": "YOUR_PROD_API_KEY",
    "ids": ["12345", "67890"],
    "includeSchemas": true
}

Replace the host with your instance (eu1, …). includeSchemas defaults to false. Set it true if trained functions depend on schemas.

HTTP 201. Each id is Added, Updated, or Error.

Same destination fields + ids:

  • POST /functions/client/replicate

  • POST /functions/server/replicate

  • POST /snippets/replicate

Prefer Glide for server/client when you can. Replicate is useful when you are not on Glide yet.

Replicate API Functions in Swagger

Path C — Manual Vari

Open Vari in one browser with the dev key. In a private window, log in with the prod key.

For each variable: create it in prod with the same context and name. Put prod values in (new secrets, not the dev ones). Set visibility to ENVIRONMENT so prod secrets are not visible in dev.

See Vari Variables.

Path D — Recreate the rest

Resource

Glide

Replicate

Manual

Server / client functions

TS + Python

REST exists

function add after poly setup with prod key

TypeScript webhooks

TS only

no

Canopy / API

API functions

no

/functions/api/replicate

train again

Snippets

no

/snippets/replicate

Canopy / API

Schemas

no

ride along with includeSchemas

recreate

Vari

no

no

two-browser copy

Jobs, Triggers, Tabi, Auth Providers, GraphQL subscriptions, Python webhooks

roadmap (no date)

no

recreate in prod

Legacy CLI redeploy

If you are not on Glide, switch the CLI to the prod key and re-run function add:

// npx poly function add echo echo.ts --context test --server
function echo(firstName: string) {
    return `Hello ${firstName}!`;
}
$ npx poly setup
$ npx poly generate
$ npx poly function add echo echo.ts --context test --server

Switch back with npx poly setup and your dev key. Do not leave the CLI pointed at prod while you hack.

Done

Prod has:

  • Vari with prod values and ENVIRONMENT visibility

  • API functions (replicate, schemas if needed)

  • Server/client functions (Glide or function add)

  • Anything from the manual checklist you actually use

Smoke-test with the prod key only.