Configuration
The bindings, vars and secret of the Chaski Worker, the settings its dashboard keeps, and the options of userRoutes().
A Chaski Worker takes its resources and the facts of its environment from wrangler.jsonc, and
its channel settings from its own dashboard. It checks them on every call, and a mistake throws a
config error that names what to fix, such as
Chaski config: the CHASKI_QUEUE binding is missing.
Bindings
The names are fixed: Chaski reads each binding by its name.
| Binding | Type | |
|---|---|---|
CHASKI_DB | D1 database | Required. Where Chaski keeps its data, with migrations_dir pointing at node_modules/chaskijs/migrations. |
CHASKI_QUEUE | Queue producer and consumer | Required. Every delivery goes through it. Set the consumer’s max_retries to 5. |
CHASKI_EMAIL | send_email | Required by the email channel. |
CHASKI_FEED | ChaskiFeed Durable Object | Required by the in-app channel. |
CHASKI_SCHEDULER | ChaskiScheduler Workflow | Required by schedule(). |
CHASKI_EVENTS | ChaskiEvents Durable Object | Live updates in the dashboard. |
CHASKI_ATTACHMENTS | R2 bucket | Required by sends that carry email attachments. |
Vars and the secret
| Name | ||
|---|---|---|
CHASKI_ENVIRONMENT | Var | Where the Worker runs, such as production, shown in the dashboard’s header and returned by ready(). Unrelated to an APNs app’s environment, which picks the APNs server. |
CHASKI_PUBLIC_URL | Var | The absolute http(s) URL where your app mounts userRoutes(). Emails load their open-tracking pixel from it; without it, they carry none. |
CHASKI_SECRET | Secret | Encrypts the channel credentials saved in the dashboard. At least 32 characters. chaskijs deploy uploads a random one with the Worker’s first deploy (wrangler deploy --secrets-file). On a Worker that already runs, set it with wrangler secret put CHASKI_SECRET: until the Worker exists, secret put creates an empty one under its name. |
access.dev in wrangler.jsonc is the identity wrangler dev signs in to the local dashboard; see
Local development.
Channel settings
The Channels page of the dashboard keeps each channel’s settings in Chaski’s database. A
channel is on once its settings are saved, and off again when you remove them. The push keys and
credentials are encrypted with CHASKI_SECRET, so push can’t be set up without it, and the
dashboard never shows them again: it says they’re Saved, and lets you replace them.
A saved setting can stop working after it was saved: a binding it needs left wrangler.jsonc, or
CHASKI_SECRET changed and its credentials no longer open. Its channel then shows as Failing,
with the reason; its deliveries fail with a config error that says the same, and the other
channels and the dashboard carry on. ready() lists them under problems. Save the setting again
to fix it.
| Field | |
|---|---|
| From | Required. An address on a domain onboarded to Email Service, which CHASKI_EMAIL allows. |
| From name | The sender’s display name. |
| Reply-to | The address replies go to. |
In-app
No fields: turning it on is the setting. It needs CHASKI_FEED.
Push
Set up any of the four. Push is on once one of them is.
| Web push | |
|---|---|
| Contact | A mailto: or https: address the push services can reach you at. |
| Keys | Generate keys makes a pair. Use existing keys takes the pair you already send with: the base64url uncompressed P-256 public key (65 bytes) and its private key, as web-push tools print them. Chaski checks that the two belong together. |
| APNs | |
|---|---|
| Team ID | Your Apple team ID. |
| Key ID | The APNs key’s ID. |
| Private key (.p8) | The .p8 file, uploaded or pasted. |
| iOS app, macOS app | Each app’s Bundle ID and Environment: Sandbox for development builds, Production for TestFlight and App Store builds. Turn on one or both. |
A device that registers with an environment of its own overrides its app’s.
| FCM | |
|---|---|
| Service account key | The service account’s JSON key file from the Firebase console, uploaded or pasted. |
| WNS | |
|---|---|
| Directory (tenant) ID | The tenant of the Microsoft Entra app registration. |
| Application (client) ID | The app registration’s ID. |
| Client secret | One of its client secrets. |
Muted by default
Types every contact has muted until they save preferences of their own, such as a weekly digest people opt into; see Preferences.
Languages
The languages your templates are written in: the default, which every template starts in, and the others a template can add translations in. With none saved, Chaski sends every template’s content as written, in one language, and the formatting filters write English.
| Setting | |
|---|---|
| Default language | A BCP 47 tag, such as en. It changes only while no template has a translation. |
| Other languages | Tags such as es, pt-BR. Taking one off keeps its translations, unused until you add it back. |
A template file with translations loads only once the
languages are saved, with its defaultLocale as the default.
userRoutes()
The options of the routes your app mounts for its frontend:
| Option | |
|---|---|
chaski | Required. (c) => c.env.CHASKI: the app’s service binding to ChaskiEntrypoint. |
identify | Required. Returns the signed-in user’s id, null to answer 401, or a Response. |
allowedOrigins | Origins of your frontend when it’s served from another origin than these routes. Your app answers CORS for them: see Browser clients. |
groups | The routes the mount serves: ['feed', 'push', 'preferences'] by default. A team inbox identify names team:<id> serves ['feed']: a browser belongs to one contact, so registering it there would take it from the user’s own inbox. Leave out preferences when your app keeps a preferences API of its own, so the browser can’t write around its rules. |
allowPush | (c, recipientId) => boolean, asked before a device is registered; false answers 403. Removing a device is always allowed. |
Mount userRoutes() once per inbox: each mount’s identify names its contact, with a feed, a
socket and an unread count of its own.
Updated Oct 30, 2026
MIT License · chaski.sh