Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
313 lines (269 loc) · 20.4 KB
/
Copy path.env.example
File metadata and controls
313 lines (269 loc) · 20.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# Copy to .env.local for local development. On Vercel, add these in Project Settings > Environment Variables.
# Names only: never commit values.
# Self-hosted, required: BETTER_AUTH_SECRET, SUPPRESSION_HASH_KEY, APP_URL (outside Vercel), ADMIN_EMAILS, EMAIL_FROM.
# FlockStack Cloud adds FLOCKSTACK_CLOUD=true, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET and RESEND_API_KEY.
# ─── Mode ──────────────────────────────────────────────────────────────────────
# Exactly "true" on FlockStack Cloud (flockstack.io): billing and plan limits, open sign-up, and FlockStack's own
# emails through Resend only. The server refuses to start without the Stripe keys
# and RESEND_API_KEY. Leave it unset on a self-hosted server: no billing, no limits, sign-in limited to the
# allowlist below. The public pages read it at build time, so set it for builds too.
FLOCKSTACK_CLOUD=
# ─── Required ──────────────────────────────────────────────────────────────────
# There is no database URL: documents live in the Cloudflare D1 database bound as DB in wrangler.jsonc. For a local run
# outside Workers (tests, scripts), FLOCKSTACK_SQLITE=<file path or :memory:> uses a SQLite file instead. Local dev with
# `wrangler dev` reads these from .dev.vars.
FLOCKSTACK_SQLITE=
# Image uploads: "r2" stores them in the R2 bucket bound as IMAGES, served from IMAGES_CDN_URL (a custom domain or the
# bucket's public r2.dev address).
IMAGES_STORAGE=
# Signs sessions and, through keys derived from it, every link in sent emails (unsubscribe, confirm, tracking).
# At least 32 random characters, or the server refuses to start: openssl rand -base64 48
# Rotating it signs everyone out and breaks the links in emails already sent, unless the old value goes in
# BETTER_AUTH_SECRET_PREVIOUS first (docs/AUTH-ROTATION.md).
BETTER_AUTH_SECRET=
# Only during a rotation: the values BETTER_AUTH_SECRET had before, comma-separated, newest first. Sessions, OAuth keys and links
# signed with them keep working; nothing is signed with them. Same for SUPPRESSION_HASH_KEY_PREVIOUS.
BETTER_AUTH_SECRET_PREVIOUS=
# Keys the hashes of the never-email list every account on the server shares: addresses an email provider said don't
# exist, for 180 days, and spam traps, for good, which imports, signups and sends skip. Only keyed hashes are kept.
# At least 32 random characters of its own, never BETTER_AUTH_SECRET, or the server refuses to start:
# openssl rand -base64 48. Changing it empties the list, unless the old key goes in SUPPRESSION_HASH_KEY_PREVIOUS first.
SUPPRESSION_HASH_KEY=
SUPPRESSION_HASH_KEY_PREVIOUS=
# Public URL of the app, no trailing slash: email links, Stripe return URLs and Better Auth use it, and so
# do the docs, the OpenAPI document and /llms.txt (read when they are served). On Vercel it defaults to the production
# domain.
APP_URL=http://localhost:3000
# FlockStack Cloud's regions: the same code as one Worker per region, each with its own database (README, Regions).
# "eu" on the EU Worker (eu.flockstack.io); unset or "us" everywhere else. It sets the session cookie prefix, the API key
# prefix (mc_eu_) and what the account and admin pages say. Set SES_REGION and QSTASH_URL to the same region.
FLOCKSTACK_REGION=
# Each region's app address for the region picker and the "sign in there" links. These are the defaults.
REGION_URL_US=https://flockstack.io
REGION_URL_EU=https://eu.flockstack.io
# ─── Sign-in ───────────────────────────────────────────────────────────────────
# Comma-separated emails that can open /admin. On a self-hosted server they can sign in too.
ADMIN_EMAILS=
# Self-hosted only: who else can sign in, comma-separated addresses and whole domains (jane@example.com, @example.org).
# Checked at every sign-in, by code, Google or Apple. With this and ADMIN_EMAILS empty, nobody can sign in.
ALLOWED_EMAILS=
# FlockStack's own emails (sign-in codes, alerts) go through Resend when this is set. FlockStack Cloud requires it
# and never sends them any other way. A self-hosted server without it sends them through the email provider
# (SES, or a PostShiba tenant of their own), from EMAIL_FROM. Without either, development prints sign-in codes
# in the server console; production can't send them.
RESEND_API_KEY=
# Set to ses to explicitly send platform mail through SES while retaining a Resend key for rollback.
PLATFORM_EMAIL_PROVIDER=
# From address of those emails, on a domain Resend or the email provider verified. Required on a self-hosted
# server; FlockStack Cloud's default is "FlockStack <hello@r.flockstack.io>". On PostShiba it needs a domain no
# newsletter sends from: a domain belongs to one tenant there.
EMAIL_FROM=
# Google sign-in. The button shows only when both are set. The allowlist applies.
# Authorized redirect URI: <APP_URL>/api/auth/callback/google
# The same client connects Google Postmaster Tools on /admin, for Gmail's spam rates: add the redirect URI
# <APP_URL>/api/admin/postmaster/callback and enable the Gmail Postmaster Tools API in its project. It needs
# CREDENTIALS_ENCRYPTION_KEY and CRON_SECRET too; without them, or until an admin connects, nothing runs.
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Optional: the domain Postmaster Tools reads, one that DKIM-signs every email. Default SHARED_DOMAIN.
POSTMASTER_DOMAIN=
# Sign in with Apple. The button shows only when all four are set. The allowlist applies. README, Optional, has the
# Apple Developer setup: an App ID, a Services ID with your domain and the return URL <APP_URL>/api/auth/callback/apple,
# and a key with Sign in with Apple. FlockStack signs Apple's client secret from the key itself, a day at a time.
# The Services ID, for example io.flockstack.signin.
APPLE_CLIENT_ID=
APPLE_TEAM_ID=
APPLE_KEY_ID=
# The .p8 key's contents, PEM. On one line, write its line breaks as \n.
APPLE_PRIVATE_KEY=
# ─── Product analytics (FlockStack Cloud only) ──────────────────────────────────
# PostHog on FlockStack's own pages, one project for both regions (README, Product analytics). Not part of the open source:
# a self-hosted server ignores all three. Unset POSTHOG_KEY: nothing loads and nothing renders.
# The project's public key (phc_...), the same on both Workers. Read when a request renders.
POSTHOG_KEY=
# Optional, an https address. Default https://us.i.posthog.com (PostHog US Cloud).
POSTHOG_HOST=
# "true" turns session recording on, with every input and all text masked. Default off. The Privacy page says it is off.
POSTHOG_SESSION_REPLAY=
# ─── Support assistant (FlockStack Cloud only) ──────────────────────────────────
# The help chat answers from FlockStack's docs with the text AI below (README, Support assistant). Without one it doesn't render.
# A self-hosted server ignores it.
# Answers a day per Worker, all visitors together. Default 300.
SUPPORT_DAILY_LIMIT=
# Where "Email a human" sends a conversation. Default hello@flockstack.io, the address on the legal pages.
SUPPORT_EMAIL=
# ─── AI writing tools ───────────────────────────────────────────────────────────
# ─── Text AI ────────────────────────────────────────────────────────────────────
# The editor's writing tools, the support and account assistants, Reply Rules and reader-requested translations (README, Text AI).
# Your own Anthropic key first, your own Groq key if Anthropic can't answer, Workers AI (the "ai" binding in wrangler.jsonc) when
# neither is set. On FlockStack Cloud neither key is used until AI_PROVIDERS_NOTICE_SENT_ON in lib/legal.js is 30 days old.
# These are not a Briefing's keys: those are each owner's own.
ANTHROPIC_API_KEY=
GROQ_API_KEY=
# Optional model names. Defaults claude-haiku-5-5, claude-sonnet-5-5 and openai/gpt-oss-20b.
AI_MODEL_FAST=
AI_MODEL_STRONG=
AI_MODEL_FALLBACK=
# true sends all of it back to Workers AI.
AI_PROVIDERS_DISABLED=
# Without any of the above the buttons don't render. On FlockStack Cloud each plan
# has its daily requests in lib/plans.js; a self-hosted server has none, unless this is set.
# AI requests a day per account, counted in UTC days. 0 turns the tools off. Empty: no limit.
AI_DAILY_LIMIT=
# ─── Stock photos ───────────────────────────────────────────────────────────────
# Unsplash's free photos in the editor's image picker (README, Stock photos). Without a key the tab is hidden. Create an
# application at unsplash.com/developers; the demo tier allows 50 requests an hour until Unsplash approves it for production.
UNSPLASH_ACCESS_KEY=
# Optional: the name the application is registered under, the utm_source of every link back to Unsplash. Default flockstack.
UNSPLASH_APP_NAME=
# GIPHY's GIFs in the editor's image picker (README, GIFs). Without a key the GIFs tab is hidden and search_gifs answers unavailable.
# Create an app at developers.giphy.com; a beta key is rate limited until GIPHY approves it for production.
GIPHY_API_KEY=
# ─── Billing (FlockStack Cloud only) ────────────────────────────────────────────
# Who bills the plans: Polar when POLAR_ACCESS_TOKEN is set, else Stripe when STRIPE_SECRET_KEY is, else nobody and
# plans can't be bought yet.
# Organization access token of the Polar organization (Settings > Developers), with the products, checkouts,
# customer sessions and subscriptions scopes. Products are found by metadata, not by ID: scripts/polar-setup.mjs creates them.
POLAR_ACCESS_TOKEN=
# Signing secret of the webhook endpoint <APP_URL>/api/webhooks/polar.
POLAR_WEBHOOK_SECRET=
# "sandbox" for Polar's sandbox (its own organization, token and secret); empty: production.
POLAR_SERVER=
# Secret key of the Stripe account. Prices are found by lookup key (see the README), not by ID.
STRIPE_SECRET_KEY=
# Signing secret of the webhook endpoint <APP_URL>/api/webhooks/stripe.
STRIPE_WEBHOOK_SECRET=
# ─── Selling to readers (products and paid subscriptions) ───────────────────────
# Readers pay the creator's own Stripe account and FlockStack takes no cut: only Stripe's processing fee comes off.
# This is apart from plan billing above. Self-hosted: STRIPE_SECRET_KEY (above) is the key of the Stripe account that gets
# paid. FlockStack Cloud: each account connects its own Stripe account (Stripe Connect), and this is the platform's key.
# Empty: STRIPE_SECRET_KEY.
STRIPE_CONNECT_SECRET_KEY=
# Signing secret of the webhook endpoint <APP_URL>/api/webhooks/payments (on FlockStack Cloud, one that listens to events
# on connected accounts). It is not STRIPE_WEBHOOK_SECRET: every Stripe endpoint has a secret of its own.
STRIPE_PAYMENTS_WEBHOOK_SECRET=
# Products' files live in a private R2 bucket bound as FILES in wrangler.jsonc, with no public domain.
# ─── Sending ───────────────────────────────────────────────────────────────────
# Kill switch for readers' emails: nothing goes to them unless this is exactly "true". Sign-in codes and alerts
# don't wait for it.
SENDING_ENABLED=false
# postshiba or ses. Empty: postshiba when POSTSHIBA_API_KEY is set, else ses. Any other value stops sending.
EMAIL_PROVIDER=
# Campaign emails per second across all accounts (default 14, 1 to 1000): SES's max send rate, or PostShiba's
# bulk cluster cap per hour divided by 3600. With Upstash Redis it's shared by every server instance.
SEND_RATE_PER_SECOND=
# ─── PostShiba ─────────────────────────────────────────────────────────────────
# A full access API key of the PostShiba team, and the team id (both on PostShiba's API keys page).
POSTSHIBA_API_KEY=
POSTSHIBA_TEAM_ID=
# The cluster every email goes out on: campaigns and their last-chance emails over HTTP inject, welcome,
# confirmation and test emails through POST /sends.
POSTSHIBA_BULK_CLUSTER_ID=
# Optional: a second cluster for welcome, confirmation and test emails, so they never wait behind a campaign.
POSTSHIBA_TRANSACTIONAL_CLUSTER_ID=
# Signing secret of the team-wide webhook endpoint <APP_URL>/api/webhooks/postshiba.
POSTSHIBA_WEBHOOK_SECRET=
# Optional, default https://app.postshiba.com and https://inject.postshiba.com/api/inject/v1.
POSTSHIBA_API_URL=
POSTSHIBA_INJECT_URL=
# 32 random bytes, base64: openssl rand -base64 32. Encrypts each tenant's SMTP password at rest (PostShiba
# shows it once), and Postmaster Tools' refresh token. Changing it makes them unreadable: those tenants need new
# credentials, and Postmaster Tools a new connection.
CREDENTIALS_ENCRYPTION_KEY=
# ─── Amazon SES ────────────────────────────────────────────────────────────────
SES_REGION=us-east-1
# IAM keys for SES in the AWS account FlockStack sends from. Required for anything SES: there's no fallback to
# ~/.aws or other default AWS credentials. Vercel reserves the AWS_* names, hence SES_*.
SES_ACCESS_KEY_ID=
SES_SECRET_ACCESS_KEY=
# 12-digit ID of that AWS account: SES identity ARNs are built from it.
SES_AWS_ACCOUNT_ID=
# SNS topic ARN that receives bounces, complaints and deliveries at /api/webhooks/ses. Every account's
# configuration set (created with its SES tenant) publishes to it.
SES_SNS_TOPIC_ARN=
# Optional: SNS topic ARN that EventBridge feeds with SES tenant status changes and reputation findings,
# subscribed to /api/webhooks/ses-tenants. A paused tenant pauses the account.
SES_TENANT_SNS_TOPIC_ARN=
# ─── Domains ───────────────────────────────────────────────────────────────────
# Optional shared domain, with its DNS on Vercel: every newsletter without its own domain sends from
# hello@<slug>.SHARED_DOMAIN (a sending subdomain in its account's tenant, its records published by the DNS
# helper below) and has its archive at <slug>.SHARED_DOMAIN. Add _dmarc.SHARED_DOMAIN yourself, once. It can be APP_URL's own
# domain, as flockstack.io is on FlockStack Cloud: slugs can't take www or the other names in lib/reserved-slugs.js.
# Without it, newsletters send from a domain of their own.
SHARED_DOMAIN=
# Host that archive subdomains point at with a CNAME, e.g. cname.vercel-dns.com on Vercel: customers' own, and
# the shared subdomains FlockStack publishes (cname.vercel-dns.com when empty). Without it, the Domains page doesn't
# ask for customers' archive subdomains, and archives stay on the shared subdomain or at /archive/<slug> on APP_URL.
ARCHIVE_CNAME_TARGET=
# FlockStack Cloud on Cloudflare (README, Domains on Cloudflare): customers' archive subdomains become Cloudflare for SaaS
# custom hostnames on this zone, each with a Worker route to this region's Worker. Needs ARCHIVE_CNAME_TARGET (each
# Worker its own: sites.flockstack.io, sites-eu.flockstack.io) and FLOCKSTACK_CLOUD=true. Without them, the customer's
# CNAME is checked as before.
CLOUDFLARE_SAAS_ZONE_ID=
# A token limited to the zones it writes to: SSL and Certificates Edit, Workers Routes Edit and Zone Read on the SaaS
# zone, DNS Edit and Zone Read on SHARED_DOMAIN's zone. The only module that uses it is lib/cloudflare-api.js.
CLOUDFLARE_API_TOKEN=
# The Worker each route points at. Defaults to flockstack, or flockstack-eu with FLOCKSTACK_REGION=eu.
FLOCKSTACK_WORKER_NAME=
# SHARED_DOMAIN's zone on Cloudflare: shared addresses' DNS records go there through Cloudflare's API (with
# CLOUDFLARE_API_TOKEN), instead of the DNS helper below. At most CLOUDFLARE_DNS_DAILY_CAP new shared addresses a day (150).
CLOUDFLARE_SHARED_ZONE_ID=
CLOUDFLARE_DNS_DAILY_CAP=
# The DNS helper that publishes and removes the shared subdomains' records: on FlockStack Cloud a Vercel project of
# its own that holds the Vercel token, which the app never has. Each request is signed with DNS_BROKER_SECRET
# (32 random bytes: openssl rand -hex 32), the same value on both. Without them (a self-hosted server, local
# development) DNS automation is off and shared addresses can't be set up.
DNS_BROKER_URL=
DNS_BROKER_SECRET=
# ─── Upstash QStash (background sending and scheduling) ────────────────────────
# QStash calls APP_URL/api/jobs/*, so APP_URL must be public (or use the QStash dev server locally).
QSTASH_TOKEN=
QSTASH_CURRENT_SIGNING_KEY=
QSTASH_NEXT_SIGNING_KEY=
QSTASH_URL=
# ─── Images ────────────────────────────────────────────────────────────────────
# Uploads from the editor, the newsletter settings and the API, stored under accounts/<accountId>/images/.
# With IMAGES_S3_BUCKET set, new ones go to that S3 bucket and are served from IMAGES_CDN_URL; otherwise to
# Vercel Blob. Without either, uploads are off. Images uploaded before stay where they are: sent emails
# point at them.
IMAGES_S3_BUCKET=
IMAGES_S3_REGION=us-east-1
# Keys of an IAM user that can only put, get and delete objects under accounts/ in the bucket, and create
# invalidations on the CloudFront distribution. There's no fallback to ~/.aws or other default AWS
# credentials, and SES keeps its own keys.
IMAGES_S3_ACCESS_KEY_ID=
IMAGES_S3_SECRET_ACCESS_KEY=
# The CDN in front of the bucket (CloudFront with Origin Access Control), e.g. https://cdn.example.com.
# Set it for builds too: next/image allows its host then.
IMAGES_CDN_URL=
# The CloudFront distribution's ID, e.g. E2EXAMPLE123. After an account's purge deletes its images, it
# invalidates /accounts/<accountId>/* there: CloudFront would keep serving them for up to a year. Without
# it (Vercel Blob, another CDN), the purge skips that step.
IMAGES_CLOUDFRONT_DISTRIBUTION_ID=
# Vercel Blob, when there's no S3 bucket.
BLOB_READ_WRITE_TOKEN=
# ─── Optional ──────────────────────────────────────────────────────────────────
# Audio versions of issues: text to speech with your own ElevenLabs account (README, Audio versions). Without
# ELEVENLABS_VOICES the feature is hidden. ELEVENLABS_API_KEY is a secret: wrangler secret put ELEVENLABS_API_KEY.
ELEVENLABS_API_KEY=
# JSON: [{"id": "<voice id>", "name": "Rachel", "description": "Calm and clear", "previewUrl": "https://..."}]
ELEVENLABS_VOICES=
# Default eleven_multilingual_v2. eleven_flash_v2_5 costs half as much per character.
ELEVENLABS_MODEL=
# An mp3_* format, default mp3_44100_128: the parts of an issue are joined byte by byte.
ELEVENLABS_OUTPUT_FORMAT=
# FlockStack Cloud only: true turns audio versions on, after the 30 days' notice of ElevenLabs as a sub-processor
# (ELEVENLABS_NOTICE_SENT_ON in lib/legal.js). A self-hosted server needs only the voices.
AUDIO_ENABLED=
# Upstash Redis: rate limits shared by every server instance (sign-in codes, signups, REST and MCP requests
# per API key, PostShiba domain checks, send rates).
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
# A Telegram bot (from @BotFather) and the chat it posts to. Admin alerts are emails to ADMIN_EMAILS; the ones that
# need someone go to Telegram too, each at most once every 6 hours. Without both, nothing goes to Telegram.
TELEGRAM_BOT_TOKEN=
TELEGRAM_CHAT_ID=
# Lets a scheduler run APP_URL/api/cron/hourly with "Authorization: Bearer <CRON_SECRET>" (Vercel Cron sends it):
# PostShiba's team status every hour, with an alert for what stops sending. And APP_URL/api/cron/postmaster every
# day: Gmail's spam rates from Google Postmaster Tools, once it's connected on /admin. openssl rand -hex 32
CRON_SECRET=