pithy add support --with-prerequisites--with-prerequisites composes secrets, which support requires.
Compose email and auth too, in practice. Without email, mail arrives and is classified and nothing can reply. Without auth, a sender is an address rather than a person with purchases attached.
What lands in your repo
apps/<worker>/pithy.config.ts gains the registration, and inboundAddresses is the field to fill in:
support({
basePath: "/support",
inboundAddresses: ["support@help.example.com"],
}),That list is what claims an address. The routing rule you create at provision time must name an address that appears here — the rule delivers the mail, and this declares that your Worker expects it.
apps/<worker>/wrangler.jsonc gains the DB binding, in every environment stanza.
Two bindings are optional and not written by add: SUPPORT_BUCKET, for attachments and raw retention, and the classification Workflow, whose deployed name is per environment. Both arrive with provision.
One migration runs, creating the message, thread and classification tables.
Read this before you provision
Cloudflare Email Routing takes over a zone’s MX records.
Use a subdomain — help.example.com — and never your apex. Provisioning on your apex zone moves your real inbound mail off your existing provider, on the day you run the command, and it is not a mistake a provisioning command gets to make on your behalf.
That is why the three routing flags are all or nothing. Pass all three and the rule is created; pass none and everything else provisions without one; pass one or two and the run is refused before anything is created — somebody who passed two of three asked for a rule, and provisioning everything except the step that delivers the mail would look like success and receive nothing.
Then provision
Everything but the rule first, which is the safe order:
pithy support provisionThat creates the project’s bucket, deploys the classification worker per environment, and creates or drops the full-text index in each environment’s app database to match your config. A newly created index is backfilled immediately, so the inbox never answers no matches for a term plainly in a body.
Then the rule, once the subdomain zone is decided:
pithy support provision \
--routing-zone <zone-id> \
--inbound-address support@help.example.com \
--app-worker acme-prodThe rule is created last, deliberately. Creating it first would start delivering mail to a Worker whose classification host is not deployed yet — a window in which real customer messages arrive and stay uncategorized with nothing to say why.
pithy support is the whole command surface.
Extending the taxonomy
Eight categories ship. Yours are added rather than replacing them:
support({
categories: defineSupportCategories({
refund_request: "Wants money back",
integration_help: "Stuck wiring us into something else",
}),
}),Category, priority and sentiment are classified together on every message. Three axes rather than one label is what makes a sortable inbox rather than a tagged one.
A wrong classification is recomputed, not repaired. Everything is derived from the immutable message, so changing the taxonomy and re-deriving is the correction — there is no row to hand-edit, and that is on purpose.
Attachments are optional
With attachments off and no raw retention, no bucket is created at all and the provision step reports it as skipped.
Turn them on and SUPPORT_BUCKET is created and bound. Attachments are somebody else’s files arriving at your infrastructure, so they get the same treatment storage gives an upload.
What composing more turns on
| Compose | What appears |
|---|---|
email | Replies go out over your domain, with correct threading headers only the Worker can set |
auth | A sender resolves to a user |
payments | That user’s purchases and entitlements appear on their record |
controlplane | The admin surface a dashboard reads. Default-denied until a client is connected and granted |
storage | Attachment handling, through the object-store seam |
audit | A trail of who read and answered what |
None is required, and each absence is a defined behavior rather than an error.
Check it worked
pithy doctor reports support under the Worker’s health.
The end-to-end check is a real message: send one to the inbound address and watch a row appear, classified. Until the routing rule exists, nothing arrives — which is the state to expect after the first provision and the reason the command tells you so in as many words.