Environment variables

Every setting plan.video reads, file by file.

The website takes its settings when it's built. Each service reads its files from /etc/plan-video when it starts.

The website

apps/web/.env, read by the dev server and by npm run build. Start from apps/web/.env.example.

KeyWhat it does
VITE_SUPABASE_URLRequiredYour Supabase project's address. Without it and the key, sign-in is off.
VITE_SUPABASE_ANON_KEYRequiredIts publishable key, which is safe in a browser
VITE_INVITE_ONLYtrue makes the website stop anyone not let in, as well as the database and services. A copy built from this repository leaves it off unless you set it.
VITE_TURNSTILE_SITE_KEYA Cloudflare Turnstile site key, which checks for bots when someone asks for a sign-in email or enters a password. Build and put up the site with it first, then turn on CAPTCHA protection in Supabase under Authentication → Attack Protection, with Turnstile's secret key. Turning it on first refuses every sign-in.
VITE_APP_URLYour site's address, like https://your-domain.com; set it for every build. Sign-in emails and the networks' logins come back to it, and the dashboard shows the agent address with it. Leave it empty on the dev server, so sign-in comes back to localhost.
VITE_LINKEDIN_PAGEStrue shows Add Page next to LinkedIn in Connections. See LinkedIn app.
VITE_SENTRY_DSNA Sentry project's DSN, for reporting a build's errors. Without it, nothing is reported and Sentry isn't loaded.
VITE_UMAMI_WEBSITE_ID, VITE_UMAMI_SCRIPT_URL, VITE_UMAMI_DOMAINSUmami analytics. Off when empty.
VITE_PUBLISHER_URLWhere the dev server sends /api/publisher. Default VITE_APP_URL, else https://plan.video. Only the dev server reads it.
VITE_AGENT_CHAT_URLAn agent chat host for the editor. Without it, the editor's agent chat stays off.
VITE_CONNECTOR_DEVtrue turns the agent connector on in the dev server too, through /api/mcp. Builds always have it.

Keys with the VITE_ prefix are built into the browser bundle, so apps/web/.env holds nothing else: the dev server and the build stop if it does.

The secrets the dev server needs to stand in for the services go in apps/web/server.env, from apps/web/server.env.example: the networks' keys, ELEVENLABS_API_KEY, ANTHROPIC_API_KEY, and Stripe's keys with BILLING_DB_KEY. Vite never reads that file, git ignores it, and a build fails if any of its values turns up in what it wrote.

Set VITE_APP_URL for every build you put up. Without it, the website takes itself for plan.video: connecting TikTok, YouTube, LinkedIn, X, Instagram, Facebook or Threads asks people to open plan.video, and "Sign in with Bluesky" is off.

Shared: r2.env

Read by every service except mcp, monitor and photos.

KeyWhat it does
SUPABASE_URLRequiredYour Supabase project's address
SUPABASE_ANON_KEYRequiredIts publishable key, for checking who's signed in
R2_ACCOUNT_IDRequiredYour Cloudflare account ID
R2_ACCESS_KEY_ID, R2_SECRET_ACCESS_KEYRequiredAn R2 API token with read and write access to the bucket
R2_BUCKETRequiredThe bucket's name
R2_JURISDICTIONThe bucket's jurisdiction: eu, fedramp, or default for a bucket made without one. Default eu.
R2_ENDPOINTThe bucket's full S3 address, in place of the R2 one the two keys above make, such as another S3-compatible store's
REQUIRE_INVITEfalse lets everyone in. Otherwise the services that act for a person, all but billing and mcp, check they were let in.
PUBLIC_URLYour site's address. The TikTok, YouTube, LinkedIn and X services allow sign-ins to come back to it and its www. address. Default https://plan.video.

publisher.env

KeyWhat it does
SUPABASE_URLRequiredYour Supabase project's address, if not in r2.env
SUPABASE_ANON_KEYIts publishable key, if not in r2.env
REQUIRE_INVITEAs in r2.env, if it's not there
SUPABASE_SERVICE_ROLE_KEYRequiredA secret key for your project. The publisher reads and writes tables browsers can't.
TOKEN_KEYRequired32 random bytes in base64, from make-keys. Seals logins, tickets and media links.
SENDER_SECRETThe password the gateway reaches the publisher with. services/deploy.sh adds it. Without it only the health check reaches the publisher: the dashboard can't send, and networks that pull a post's files can't get them.
BLUESKY_OAUTH_JWKThe "Sign in with Bluesky" key, from make-keys. Without it, Bluesky connects with app passwords only.
PUBLIC_URLYour site's address, for media links, emails, the networks' sign-in callbacks and Bluesky. Default https://plan.video.
SEND_FROMA time in ISO 8601. Runs due before it are never sent. make-keys sets it; without it, runs that fell due while the publisher was down are skipped.
RESEND_API_KEYA Resend key, to email owners about failed posts and LinkedIn logins running out
NOTICE_FROMWho those emails come from, at a domain your Resend account can send from. Set it with RESEND_API_KEY: the default, plan.video <hello@plan.video>, is plan.video's.
SUPPORT_TO, SUPPORT_FROMWho the site's support form emails, and from which address. Only plan.video's own website has that form, so a copy without it can leave these out.
BILLING_URLWhere the billing service is, to end a plan when an account is deleted. Default http://127.0.0.1:8799.
PHOTOS_URLWhere the photos service is, to make pictures for posts. Default http://127.0.0.1:8793.
YOUTUBE_UPLOADS_PER_DAYYouTube uploads a day per owner, Free to Agency. Default 3,50,100,200.
X_POSTS_PER_MONTHPosts to X in any 30 days per owner, Free to Agency. Default 0,150,400,800.
X_LINK_POSTS_PER_MONTHHow many of those can have a link. Default 0,10,25,40.

gateway.env

KeyWhat it does
SENDER_SECRETRequiredThe same value as in publisher.env. services/deploy.sh writes it.

Network files

The network's service and the publisher both read these. meta.env has no service of its own: only the publisher reads it.

FileKeys
tiktok.envTIKTOK_CLIENT_KEY, TIKTOK_CLIENT_SECRET, and TIKTOK_READ_VIDEOS=true once your app has video.list
youtube.envYOUTUBE_CLIENT_ID, YOUTUBE_CLIENT_SECRET
linkedin.envLINKEDIN_CLIENT_ID, LINKEDIN_CLIENT_SECRET, and for company Pages LINKEDIN_PAGES_CLIENT_ID, LINKEDIN_PAGES_CLIENT_SECRET
x.envX_CLIENT_ID, X_CLIENT_SECRET
meta.envINSTAGRAM_APP_ID, INSTAGRAM_APP_SECRET, FACEBOOK_APP_ID, FACEBOOK_APP_SECRET, FACEBOOK_CONFIG_ID, THREADS_APP_ID, THREADS_APP_SECRET

Network apps shows where to get each one.

agent.env

KeyWhat it does
ANTHROPIC_API_KEYRequiredAn API key from the Claude Console
AGENT_PERSON_BUDGETHow much each person can use the Assistant in a day, in input tokens, with output counted five times. One number is Creator's, and Free gets a quarter of it, Pro twice and Agency four times; or give all four as Free,Creator,Pro,Agency. Default 4000000. A team member on Free uses their owner's.
AGENT_SITE_BUDGETThe same for everyone together, the caption tools included. Default 200000000.
AGENT_FREE_SHAREThe share of AGENT_SITE_BUDGET that Free accounts can use between them, from 0 to 1, so they never use up what paying ones need. Default 0.5.
AGENT_NETWORK_BUDGETWhat Free accounts on one network (IP address, or IPv6 /64) can use between them in a day, the Assistant and caption tools together. Default 4000000.
CAPTIONS_PERSON_BUDGETEach person's daily share of the caption tools, by plan like AGENT_PERSON_BUDGET. Default 4000000.
AGENT_SIGNING_SECRETSigns the Assistant's replies, so a browser can't make up its turns. By default it comes from the API key, so a new key ends open chats.

transcribe.env

KeyWhat it does
ELEVENLABS_API_KEYRequiredAn ElevenLabs key with the Speech to Text permission

billing.env

KeyWhat it does
STRIPE_SECRET_KEYRequiredYour Stripe secret key
STRIPE_WEBHOOK_SECRETRequiredThe signing secret of the webhook setup-stripe.mjs makes
BILLING_DB_KEYRequiredLets billing write each person's plan and nothing else. Make it as below.
PUBLIC_URLWhere Stripe sends people back. Default https://plan.video.
STRIPE_AUTOMATIC_TAXtrue turns on Stripe Tax in Checkout

Make the products, prices, billing portal and webhook with services/billing/scripts/setup-stripe.mjs:

STRIPE_SECRET_KEY=sk_... PUBLIC_URL=https://your-domain.com node services/billing/scripts/setup-stripe.mjs

It's safe to run again, and prints the webhook's secret the first time.

Make BILLING_DB_KEY with services/billing/scripts/db-key.mjs. It prints the line for billing.env, and SQL for your project's SQL editor that stores only the key's hash:

node services/billing/scripts/db-key.mjs

mcp.env

KeyWhat it does
SUPABASE_URLRequiredYour Supabase project's address. Agents sign in at its OAuth server.
SUPABASE_ANON_KEYRequiredIts publishable key
PUBLIC_URLYour site's address. It names the server to agents, and the site they ask people to open, so it must be right. Default https://plan.video.
ALLOWED_ORIGINSSites whose tabs may connect, separated by commas. Default PUBLIC_URL and its www. address.

monitor.env

KeyWhat it does
HC_PING_URLYour check's ping address from Healthchecks.io. Without it, problems only go to journalctl -u plan-video-monitor.
PUBLIC_URLYour site's address. The watchdog loads it and the publisher's health from outside, and checks its certificate. Default https://plan.video.