Skip to content

Configuration

FxEmbed is configured through environment variables (.env), Wrangler settings (wrangler.toml), and an optional branding file (branding.json).

Copy .env.example to .env and configure:

These comma-separated lists define which domains route to which realm:

VariableDescriptionExample
STANDARD_DOMAIN_LISTX/Twitter embed domainsfxtwitter.com,fixupx.com,twittpr.com
STANDARD_BSKY_DOMAIN_LISTBluesky embed domainsfxbsky.app
STANDARD_TIKTOK_DOMAIN_LISTTikTok embed domainsfixtok.example.com
VariableDescriptionExample
DIRECT_MEDIA_DOMAINSd./dl. direct media subdomainsd.fxtwitter.com,dl.fxtwitter.com
TEXT_ONLY_DOMAINSt. text-only subdomainst.fxtwitter.com
INSTANT_VIEW_DOMAINSi. Telegram Instant View subdomainsi.fxtwitter.com
GALLERY_DOMAINSg. gallery subdomainsg.fxtwitter.com
FORCE_MOSAIC_DOMAINSm. mosaic subdomainsm.fxtwitter.com
OLD_EMBED_DOMAINSo. legacy embed subdomainso.fxtwitter.com
VariableDescriptionExample
API_HOST_LISTFxTwitter API host(s)api.fxtwitter.com
BLUESKY_API_HOST_LISTFxBluesky API host(s)api.fxbsky.app
GENERIC_API_HOST_LISTGeneric (Mastodon) API host(s)api.fxembed.com
VariableDescription
MOSAIC_DOMAIN_LISTMosaic image generation service endpoint(s)
GIF_TRANSCODE_DOMAIN_LISTGIF transcoding service endpoint(s)
VIDEO_TRANSCODE_DOMAIN_LISTVideo transcoding service endpoint(s)
VIDEO_TRANSCODE_BSKY_DOMAIN_LISTBluesky video transcoding endpoint(s)
POLYGLOT_DOMAIN_LISTTranslation service endpoint(s)
POLYGLOT_ACCESS_TOKENTranslation service access token
TWITTER_ROOTBase Twitter/X URL for redirects
VariableDescription
SENTRY_DSNSentry Data Source Name (leave empty to disable)
SENTRY_AUTH_TOKENSentry authentication token for source maps
SENTRY_ORGSentry organization slug
SENTRY_PROJECTSentry project slug

The wrangler.toml file configures the Cloudflare Worker:

name = "fxembed"
account_id = "YOUR_ACCOUNT_ID"
main = "./dist/worker.js"
compatibility_date = "2026-04-11"
send_metrics = false
analytics_engine_datasets = [
{ binding = "AnalyticsEngine" }
]
[build]
command = "npm run build"
  • name: Worker name (appears in *.workers.dev URL)
  • account_id: Your Cloudflare Account ID
  • compatibility_date: Cloudflare Workers API compatibility date
  • analytics_engine_datasets: Remove this block if you don’t use Cloudflare Analytics Engine

Some values should be set as Wrangler secrets rather than in .env or wrangler.toml:

Terminal window
wrangler secret put CREDENTIAL_KEY
wrangler secret put EXCEPTION_DISCORD_WEBHOOK
  • CREDENTIAL_KEY: Encryption key for credential storage
  • EXCEPTION_DISCORD_WEBHOOK: Discord webhook URL for exception notifications

Copy branding.example.json to branding.json to customize the appearance and behavior of each domain zone.

Each zone in the zones array defines:

{
"name": "FxTwitter",
"default": true,
"domains": ["fxtwitter.com", "twittpr.com"],
"provider": "twitter",
"favicon": "https://example.com/favicon.ico",
"redirect": "https://github.com/FxEmbed/FxEmbed",
"color": "#6363ff",
"activityIcons": {
"default": "https://example.com/icon32.png",
"svg": "https://example.com/icon.svg",
"16": "https://example.com/icon16.png",
"32": "https://example.com/icon32.png"
}
}
FieldDescription
nameDisplay name for this zone
defaultWhether this is the default zone (only one should be true)
domainsDomains this zone applies to
providerContent provider (twitter, bluesky, tiktok)
faviconURL to the favicon served for this zone
redirectWhere bare domain visits redirect to
colorTheme color for embeds (hex)
activityIconsIcon URLs at various sizes; activityIcons can also be an array for random selection