Skip to content

Optional tokens and secrets

amabledata works without any of the credentials on this page. Each one unlocks one feature; without it, that feature is either unavailable or done by hand. Add them one at a time, when you need them.

Credential Unlocks Without it Cloud edition
CLOUDFLARE_DNS_API_TOKEN The domain wizard creates DNS records, Workers custom domains and routes for you The wizard shows the records and you create them yourself Configured by the installer
CF_ZONE_ID, CF_API_TOKEN, TRACKING_CNAME_TARGET Tracking domains whose DNS stays at another provider (CNAME mode) Only tracking domains that are zones of the same Cloudflare account (zone mode) Depends on the installation
Ad platform apps (Meta, Google Ads, TikTok) Ad spend import and server-side conversions The platform shows as unavailable Ready to use
Google OAuth client Google Calendar for bookings: busy time read, bookings written as events Connect Google Calendar is unavailable Ready to use
Turnstile keys Bot protection on sign-in and public forms Verification disabled (a warning is logged) Created by the installer
Marketing email provider key Sending broadcasts and automation emails Marketing email cannot be sent Provided, 2,000 emails/month per workspace included
System email binding Sign-in codes, magic links, invitations, password resets by email Those emails cannot be sent Provided
ERROR_REPORTING Error reports to your own HTTPS endpoint Errors are written to the Worker logs only Fleet monitoring
ADDRESS_LOOKUP_URL Your own address autocomplete server, or turning it off The public geocoder is used Same

All of this applies mainly to self-hosted installations. In the Cloud edition these services are provided centrally or configured by the installer.

amabledata selects each outside service by configuration. When a credential is present and valid, the feature turns on; when it is missing, the feature degrades on its own and nothing else breaks. Non-secret identifiers (an app ID, a zone ID, a URL) are plain variables; passwords, keys and tokens are secrets. See the configuration reference for every variable.

DNS automation token (CLOUDFLARE_DNS_API_TOKEN)

Section titled “DNS automation token (CLOUDFLARE_DNS_API_TOKEN)”

With this token, Settings › Domains shows DNS changes are applied on your Cloudflare zone automatically. and offers Create on Cloudflare. Without it, it shows No Cloudflare API token is configured: create the records below on your DNS provider.

  1. In Cloudflare, go to My Profile › API Tokens › Create Token › Create Custom Token.

  2. Name it amabledata domains.

  3. Add these permissions:

    Scope Permission Level Used for
    Zone Zone Read Finds the active zone that covers the hostname
    Zone DNS Edit Creates or updates the records of sending domains (SPF, DKIM, DMARC and similar)
    Zone Workers Routes Edit Adds the routes of a landing and booking site served on some paths of an existing site
    Account Workers Scripts Edit Attaches a tracking hostname or a whole site hostname to the edge Worker as a Workers custom domain
  4. Account Resources: Include › your amabledata account. Zone Resources: Include › All zones from an account › your amabledata account.

  5. Create the token and copy it (it is shown once).

  6. Store it on the core Worker:

    Terminal window
    pnpm exec wrangler secret put CLOUDFLARE_DNS_API_TOKEN --config apps/core/wrangler.self-host.jsonc
  7. Reload Settings › Domains in amabledata: the automatic mode message appears.

Optional related variables: EDGE_HOSTNAME (the hostname custom domains point to, default: the host of EDGE_ORIGIN) and EDGE_SCRIPT_NAME (the Worker used for custom domains and routes, default amable-edge).

CNAME tracking domains (CF_ZONE_ID, CF_API_TOKEN, TRACKING_CNAME_TARGET)

Section titled “CNAME tracking domains (CF_ZONE_ID, CF_API_TOKEN, TRACKING_CNAME_TARGET)”

By default a tracking domain must be a zone of the same Cloudflare account as the edge Worker (zone mode, recommended, no configuration). CNAME mode lets the owner of a domain keep its DNS elsewhere and only add a CNAME record: amabledata then creates a custom hostname on a zone of yours with Cloudflare for SaaS, and Cloudflare issues the certificate. Without these three values the option shows Not configured on this installation: the domain must be a zone of this Cloudflare account.

  1. Choose the zone that serves the edge Worker (for example example.net, where track.example.net points at amable-edge), and enable Cloudflare for SaaS custom hostnames on it (in the zone: SSL/TLS › Custom Hostnames), following Cloudflare for SaaS: get started. Custom hostnames are billed by Cloudflare beyond the included quantity.

  2. Copy the Zone ID of that zone (zone Overview › API section).

  3. Create a custom token with Zone › SSL and Certificates › Edit, Zone Resources: Include › Specific zone › that zone. Copy it.

  4. Set the values on the core Worker:

    Name Type Value
    CF_ZONE_ID Variable The Zone ID from step 2
    CF_API_TOKEN Secret The token from step 3
    TRACKING_CNAME_TARGET Variable, optional The hostname customers point their CNAME at, for example track.example.net. Default: the host of EDGE_ORIGIN.
    Terminal window
    pnpm exec wrangler secret put CF_API_TOKEN --config apps/core/wrangler.self-host.jsonc

    Add CF_ZONE_ID and TRACKING_CNAME_TARGET to the vars block of deploy/self-host/core.wrangler.jsonc, then rerun pnpm self-host:setup --deploy with your usual options.

  5. In amabledata, Analytics settings (/t/<workspace>/analytics/settings) › Domains tab › Add domain now offers DNS stays elsewhere (CNAME). The status moves from Waiting for DNS to Issuing certificate to Active.

See CNAME tracking domains for the day-to-day use.

Each platform needs an OAuth app that you create on the platform’s developer site (self-hosted). The redirect URI to register on each app is <APP_ORIGIN>/oauth/ads/callback, for example https://crm.example.com/oauth/ads/callback, and it must match exactly.

Platform Secrets on the core Worker Notes
Meta META_APP_ID, META_APP_SECRET Spend import and Conversions API
Google Ads GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_DEVELOPER_TOKEN, optional GOOGLE_ADS_LOGIN_CUSTOMER_ID The login customer ID is a manager account, digits only (dashes are removed)
TikTok TIKTOK_APP_ID, TIKTOK_APP_SECRET Spend import and Events API
All Optional variable ADS_OAUTH_REDIRECT_URI Overrides the default redirect URI

A platform without both its ID and secret (and, for Google Ads, the developer token) shows as unavailable. Step-by-step guides for each platform: OAuth apps.

  1. Create a Google Cloud project, enable Google Calendar API, and configure the OAuth consent screen with the scopes calendar.readonly (busy time) and calendar.events (bookings written as events).

  2. Create an OAuth client ID of type Web application with the authorized redirect URI <APP_ORIGIN>/oauth/google/callback (fixed path).

  3. Store the values on the core Worker: GOOGLE_OAUTH_CLIENT_ID (variable or secret) and GOOGLE_OAUTH_CLIENT_SECRET (secret).

  4. After the deploy, Connect Google Calendar appears on booking calendars.

Grants are encrypted with the installation key (AUTH_ENCRYPTION_KEY) before being stored. The Google Sheets form connection does not use this client: each workspace uploads its own service account key (Form connections). Full guide: OAuth apps.

  1. In Cloudflare, open Turnstile in the account sidebar and select Add widget.

  2. Name it amabledata, add the hostnames of your app and of your public pages (for example crm.example.com, t.example.com, and the workers.dev hostnames if you use them), and choose the Managed mode.

  3. Copy the Site Key and the Secret Key.

  4. Set TURNSTILE_SITE_KEY (variable) and TURNSTILE_SECRET_KEY (secret) on the core Worker.

Without the secret, verification is disabled and the Worker logs TURNSTILE_SECRET_KEY missing — bot verification disabled at boot.

Self-hosted installations send marketing email through their own PostShiba account. The first three settings are all required:

Name Type Purpose
POSTSHIBA_API_KEY Secret Team API key of your account, with Full access
POSTSHIBA_TEAM_ID Variable Your team id (the team_id returned by the PostShiba API GET /users/me)
POSTSHIBA_CLUSTER_ID Variable The cluster on which the workspaces’ SMTP credentials are issued
POSTSHIBA_BASE_URL Variable, optional API root override (default https://app.postshiba.com/api/v1)
POSTSHIBA_INJECT_URL Variable, optional HTTP inject endpoint of your cluster (default https://inject.postshiba.com/api/inject/v1)
POSTSHIBA_WEBHOOK_SECRET Secret, optional Extra comma-separated secrets accepted on delivery webhooks; normally not needed

Set the key with wrangler secret put and the two ids in the vars block of deploy/self-host/core.wrangler.jsonc (they are already there, commented out), then rerun pnpm self-host:setup --deploy. You create nothing else at PostShiba: each workspace gets its own PostShiba tenant, SMTP credential and delivery webhook (with its own secret) when it connects its first sending domain in Settings › Domains. Removing a sending domain in amabledata deletes it at PostShiba too. See Email sending settings and the configuration reference.

System email (your own Cloudflare Email Sending)

Section titled “System email (your own Cloudflare Email Sending)”

System emails (sign-in codes, magic links, invitations, password resets, role change notices, and the notice sent to the sender when someone declines to sign a document) need a sender:

  1. Onboard your domain to Cloudflare Email Sending, for example with pnpm exec wrangler email sending enable example.com.

  2. In deploy/self-host/core.wrangler.jsonc, uncomment the binding "send_email": [{ "name": "SYSTEM_EMAIL" }].

  3. In the same file, set the variable SYSTEM_EMAIL_FROM (for example no-reply@example.com) and optionally SYSTEM_EMAIL_FROM_NAME.

  4. Rerun pnpm self-host:setup --deploy with your usual options.

Without it, system emails fail with System email is not configured: add a send_email binding named SYSTEM_EMAIL plus SYSTEM_EMAIL_FROM (Cloudflare Email Sending), or a LICENSE_KEY for the managed notify service. You can force a provider with SYSTEM_EMAIL_PROVIDER (auto default, cloudflare, notify, console which works only in development).

  • ERROR_REPORTING: local (default, logs only) or an https:// URL that receives error reports. ERROR_SAMPLE_RATE (0 to 1, default 1) samples repeated errors.
  • ADDRESS_LOOKUP_URL: by default address autocomplete uses the public Photon geocoder (OpenStreetMap data, fair use). Point it at your own Photon instance (for example https://photon.example.com/api) or set off to keep addresses manual only.
Name Type Worker Feature
CLOUDFLARE_DNS_API_TOKEN Secret core Domain wizard automation
EDGE_HOSTNAME Variable core Target of custom domains (default: host of EDGE_ORIGIN)
EDGE_SCRIPT_NAME Variable core Worker for custom domains and routes (default amable-edge)
CF_ZONE_ID Variable core CNAME tracking domains
CF_API_TOKEN Secret core CNAME tracking domains (SSL and Certificates: Edit)
TRACKING_CNAME_TARGET Variable core CNAME target shown to users (default: host of EDGE_ORIGIN)
META_APP_ID, META_APP_SECRET Secret core Meta ads
GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_LOGIN_CUSTOMER_ID Secret core Google Ads
TIKTOK_APP_ID, TIKTOK_APP_SECRET Secret core TikTok ads
ADS_OAUTH_REDIRECT_URI Variable core Ads redirect override
GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET Variable / Secret core Google Calendar
TURNSTILE_SITE_KEY, TURNSTILE_SECRET_KEY Variable / Secret core Bot protection
POSTSHIBA_API_KEY, POSTSHIBA_TEAM_ID, POSTSHIBA_CLUSTER_ID Secret / Variable / Variable core Marketing email (all three required)
POSTSHIBA_BASE_URL, POSTSHIBA_INJECT_URL, POSTSHIBA_WEBHOOK_SECRET Variable / Variable / Secret core Marketing email, optional overrides
SYSTEM_EMAIL (binding), SYSTEM_EMAIL_FROM, SYSTEM_EMAIL_FROM_NAME, SYSTEM_EMAIL_PROVIDER Binding / Variables core System email
ERROR_REPORTING, ERROR_SAMPLE_RATE Variables core Error reports
ADDRESS_LOOKUP_URL Variable core Address autocomplete
  • Setting secrets requires access to the Cloudflare account (Wrangler login or dashboard). Nothing on this page can be changed from inside amabledata.
  • Connecting ad accounts and tracking domains from the app requires the analytics:configure permission (owner, admin and marketer). The domain wizard in Settings › Domains requires domains:manage (owner and admin). See Roles and permissions.
  • Never reuse the Cloud installer token for these features: give each token only the permissions listed for it.
Symptom Cause Fix
Create on Cloudflare fails with no Cloudflare zone of this account covers the hostname The domain is not an active zone of the account, or the token’s Zone Resources exclude it Add the domain to the account and wait for Active; check the token resources.
no Cloudflare API token is configured: create the records manually CLOUDFLARE_DNS_API_TOKEN missing Set the secret, or create the records by hand.
Custom tracking domains are not configured on this installation. CNAME mode credentials missing Set CF_ZONE_ID and CF_API_TOKEN, or use zone mode.
The certificate service did not answer. Try again in a moment. The custom hostname API call failed Check the token permission (SSL and Certificates: Edit) and that Cloudflare for SaaS is enabled on the zone.
An ad platform or Google shows as unavailable The app credentials are missing or incomplete Set every listed secret for that platform.
The OAuth provider says the redirect URI does not match The URI registered on the app differs from <APP_ORIGIN>/oauth/... Register the exact URI, including https:// and without a trailing slash.
A variable disappeared after an update It was set in the dashboard or in the generated file, and the deploy replaced it Put it in deploy/self-host/core.wrangler.jsonc or store it as a secret.