Open-Source Wikis

/

tldraw

/

Reference

/

Configuration

tldraw/tldraw

Configuration

Where runtime options, environment variables, and SDK options come from.

Editor options

packages/editor/src/lib/options.ts defines TLEditorOptions — the per-editor configuration object passed to <TldrawEditor options={...} /> and new Editor({ options }). It is the canonical place to look for "what knobs does the editor have?". Examples:

  • Animation durations.
  • Pointer/touch tolerance thresholds.
  • Edge-scroll trigger zone width.
  • Maximum shape count per page.
  • Default fonts.
  • Snap thresholds.

The defaults are exported as TLEditorOptionsDefaults; passed options merge into them.

SDK options

<Tldraw /> accepts a superset of the editor's options. Common props:

  • shapeUtils, tools, bindings — extend or replace the default sets.
  • overrides — UI override schema (see packages/tldraw/src/lib/ui/overrides.ts).
  • assetUrls — overrides for icons and translations.
  • onMount — callback that receives the constructed Editor.
  • licenseKey — production license key.

Environment variables

Each app uses Vite/Next's standard env-loading. The conventions:

  • apps/dotcom/client — Vite envs prefixed VITE_… in .env* files. The vite.config.ts exposes VITE_PREVIEW=1 for preview builds.
  • apps/docs — Next.js envs (NEXT_PUBLIC_…).
  • apps/examples — Vite, mostly free of envs (the dev fixture intentionally has minimal config).
  • Workers (apps/*-worker, apps/dotcom/*-worker) — secrets defined in wrangler.toml and pushed via wrangler secret put.

Cloudflare Worker config

Each worker workspace has its own wrangler.toml:

  • apps/bemo-worker/wrangler.toml
  • apps/dotcom/sync-worker/wrangler.toml
  • apps/dotcom/asset-upload-worker/wrangler.toml
  • apps/dotcom/image-resize-worker/wrangler.toml
  • apps/dotcom/tldrawusercontent-worker/wrangler.toml
  • apps/mcp-app/wrangler.toml
  • apps/analytics-worker/wrangler.toml

These declare bindings (R2 buckets, KV namespaces, Durable Objects, secrets) and routes. Read them when wiring a new binding.

Fly.io config

apps/dotcom/zero-cache/flyio-replication-manager.template.toml and apps/dotcom/zero-cache/flyio-view-syncer.template.toml are templated TOMLs. Recent churn is concentrated here as the team scales the view-syncer fleet.

Build config

  • Repo root: lazy.config.ts (lazyrepo task graph), eslint.config.mjs, .oxlintrc.json, .oxfmtrc.json, .prettierrc, .prettierignore, tsdoc.json, vitest.config.ts, lerna.json.
  • Per-package: tsconfig.json, vitest.config.ts, playwright.config.ts where applicable.
  • TypeScript shared configs: internal/config/.

Husky and lint-staged

package.json configures lint-staged to run oxfmt --no-error-on-unmatched-pattern on every staged JS/TS/CSS/MD/JSON/YAML file. Husky hooks under .husky/ invoke lint-staged on commit.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Configuration – tldraw wiki | Factory