@oneaddress/setup
Interactive setup wizard for OneAddress partner webhook integrations. It takes you
from a signed-up partner account to a running, publicly reachable, conformance-checked
receiver.
Before you start
Sign in at the Partner Portal and open My Profile.
You need two values from it, and the first one is the wizard's very first prompt:
| What |
Where |
Notes |
| CLI token |
Profile → CLI Access |
Shown once when you mint it. It identifies you, which is why the wizard never asks for a Partner ID. |
| Webhook signing secret |
Profile → Webhook |
The wizard checks it against the portal the moment you paste it, so a wrong one is caught in seconds rather than as a 401 at the end. |
You also need an ECDH P-256 private key, but only if your receiver is going to
decrypt addresses itself. Setting up for the first time? Let the wizard generate it.
It makes the key pair on the server you are running it on, keeps the private key there
only, and registers just the public key after proving to the portal that this machine
holds the private one. Before registering anything it saves a copy of the private key to
~/.oneaddress/keys/, readable only by you, so an interrupted run never loses it; move that
copy into your own secret store once your receiver is running. Your security contact is
emailed to confirm the fingerprint, as with a key made in the portal. If you already have a key, paste the base64 body from the
portal's Copy button, or give the wizard a path to the .pem file you downloaded; it
accepts either, plus a couple of older formats.
Node version. The wizard itself runs on Node 18+. The TypeScript scaffold needs
Node 22.5+, because its customer store uses the built-in node:sqlite module. The
wizard tells you in its first seconds if your Node is too old, and refuses rather than
scaffolds if you then pick TypeScript.
Quick start
npx @oneaddress/setup
The wizard asks:
- Your CLI token, then your webhook signing secret (verified against the portal
there and then).
- Which platform: TypeScript / Node.js, Python, Go, PHP, Java, or C#.
- For TypeScript only, how the receiver handles updates:
- Apply them itself (the default). It decrypts and writes to a customer store on
this machine. Right for a sole trader, or for trying it out.
- Hold them for your own systems to collect (inbox mode). It holds ciphertext
and keeps no private key, so the process cannot read what it stores. It needs a
connector you run separately, and the wizard prints the credential that connector
will use. The other five languages have no inbox implementation, so they are not
offered the choice.
- Your private key: generate one here (first-time setup, recommended) or paste the
one you have. Skipped entirely in inbox mode, where the key belongs in your connector
and nowhere else.
- Which port to listen on. Default 3001; 3002 and 3003 are refused because they
belong to the inbox draw channel and the connector.
- Where to write the files.
Then it works, without asking:
- Scaffolds a real webhook server for your platform.
- Installs its dependencies.
- Starts it and waits for
/health.
- Gets it a public HTTPS URL: yours if you have one, otherwise a free Cloudflare
tunnel. It then waits until that URL actually routes to your server.
- Registers the URL in the portal, on the path your platform's scaffold serves
(
/webhook for TypeScript, Python, Go and PHP; /webhooks/oneaddress for Java and
C#).
- Runs the conformance checks against the live URL, then asks the portal to send an
encrypted probe so a wrong private key fails here rather than at go-live.
- For TypeScript, offers to open the receiver dashboard.
A Cloudflare tunnel URL lives only while the wizard is running, and every run gets a new
one. It is for getting to a passing check today, not for production.
What you get
A real webhook server, not a toy:
- HMAC-SHA256 signature verification, timing-safe
- ECDH P-256 + HKDF-SHA256 + AES-256-GCM address decryption
- Replay-window enforcement (±5 min) before signature verification
- Persistent dispatch deduplication
- A fire-and-forget
/api/confirm callback, signed over the exact bytes it posts
- A demo roster of 24 customers in
customers.json, so an end-to-end match works
before you have wired anything up
- A Dockerfile, a compose file, a
.dockerignore and a systemd unit, in every
language but PHP, so "run it where it will live" is a command rather than an
exercise. The .dockerignore is the one to read: without it, COPY . . puts your
signing secret and your private key inside an image layer
- Alerting and a
/metrics endpoint, in all six, both off until you configure
them. This is the half that matters most on the five languages with no dashboard,
where everything the receiver knew about its own health previously reached a log
nobody reads until after a customer has complained
- For TypeScript: a terminal dashboard, an at-rest passphrase for the local database, and
an applied-change audit trail
Wiring it to your database
Read src/customer-store.ts first. That is the contract: five methods, a paragraph
each, no schema and no encryption in the way. It is the file to hand a DBA.
src/store.ts is the default implementation of that contract, backed by the bundled
SQLite file. Replace it with your own and delete everything in it you do not need. The
other languages follow the same split (store.go, OneAddressStore.java,
OneAddressStore.cs, and the store section of app.py).
Going to production
The tunnel is temporary by design. A Cloudflare quick tunnel lives only while the
wizard runs and every run mints a new URL, so the first thing to do after a green
conformance check is move to a host of your own.
docker compose up -d --build # the files are in your scaffold
npx @oneaddress/setup --set-url https://receiver.yourcompany.com/webhook
--set-url changes one field in the portal and does nothing else: no scaffolding,
no install, no tunnel. Run it from your scaffold directory and it reads the partner
id and signing secret out of the files the wizard already wrote. The portal also
needs your CLI token to change the URL, because the signing secret alone must
not be enough to redirect dispatches: it asks for it without echo, or reads
ONEADDRESS_CLI_TOKEN (mint one at partners.oneaddress.io, Profile & contacts, CLI
access tokens). OA_PARTNER_ID and OA_WEBHOOK_SECRET override the files; in CI,
set all three, because with --yes and no terminal there is nothing to ask.
It refuses in three ways, and the refusals are the point:
|
|
| a secret the portal does not accept |
checked first, so a wrong secret is not mistaken for an unreachable receiver |
| a URL nothing answers |
it sends a correctly signed request and requires a 2xx. The portal will accept a URL nothing serves, and dispatches then stop arriving with no error on either side. --skip-check overrides |
| a temporary tunnel host |
trycloudflare.com and friends. Registering the wizard's own tunnel as your production URL is the mistake this exists to prevent. --force overrides |
http:// is refused with no override at all.
| Flag |
|
--set-url <https url> |
where your receiver now lives |
--dir <dir> |
the scaffold to read credentials from (default: the current directory) |
--yes |
do not ask for confirmation |
--skip-check |
register even if nothing answers there yet |
--force |
allow a temporary tunnel host |
Run one receiver. Its confirm queue and quarantine are a local file, so a second
container is a second receiver with its own backlog rather than a second worker on
the first one's. If you need more than one instance, a metrics endpoint, or a
different database behind the receiver's own bookkeeping, talk to us before building
around it: that is a different piece of software and we would rather give it to you.
Knowing when it breaks
Set two environment variables on your receiver and it stops being silent.
| Variable |
|
ONEADDRESS_ALERT_URL |
One JSON POST when a condition starts, and one when it clears. Slack, Teams, PagerDuty, or your own endpoint. |
ONEADDRESS_ALERT_TOKEN |
Optional bearer token for that endpoint. Never reuse your webhook signing secret: a chat webhook is a different system with a different threat model. |
ONEADDRESS_METRICS_TOKEN |
Turns on GET /metrics, Prometheus text. Without it that path answers 404, not 401 — an unconfigured receiver should not advertise that the endpoint is there. |
Two conditions everywhere, and two more on TypeScript:
| Condition |
|
confirm_backlog |
Acknowledgements owed to OneAddress are not draining. The consumer sees an update that never completed, and OneAddress may eventually refund an update your receiver applied perfectly. |
signature_rejected |
Dispatches refused for a bad signature: your receiver and OneAddress disagree about the signing secret, so nothing will ever arrive successfully until it is fixed. |
dispatch_held (TS) |
Dispatches arrived that could not be opened. Held, encrypted, replayable once the cause is fixed. |
store_unencrypted (TS) |
The bundled store is running without at-rest encryption. Silent once you have swapped in your own database, because that one is not ours to report on. |
It throttles and it resolves: one alert per condition per hour, and a resolved
event when it clears. An alerting feature that fires on every held dispatch and never
says the problem went away is a pager storm, and a pager storm gets muted in week one.
The payload carries no customer data, by construction — counts, a condition name
and a transport error, never an address, a name or an account reference.
PHP exposes /metrics and pushes nothing, deliberately: it is a route inside your
own Laravel application, PHP-FPM gives every request its own process, and your
application already has a scheduler and a monitoring stack. What it lacked was the
numbers.
How your credentials are kept
The wizard asks, and plain text is never the answer you fall into:
- Sealed file (the default where it is offered). Your signing secret and private key
are encrypted into
oneaddress.sealed under a passphrase you choose, and nothing
readable is written to disk. The receiver asks for the passphrase when it starts, or
reads it from ONEADDRESS_DB_PASSPHRASE. Offered for TypeScript, Python, Go, Java and
C#. Not for PHP, which starts a fresh process for every request and would run a
deliberately slow key derivation on each webhook.
- Your own secrets manager or platform. Nothing secret is written at all. The
scaffolded README lists the variables to supply.
- Plain text. What every version before 3.0.0 did. It is last in the list and asks
once more before it does it.
On Windows the credentials file is restricted to your account and SYSTEM; the POSIX mode
it was written with changes nothing there. If the passphrase is lost the credentials are
not: set the receiver up in a fresh folder and seal them again. Nobody, OneAddress
included, can open the old file.
Updating a receiver
npx @oneaddress/setup@latest update # in the receiver's folder, or its parent
npx @oneaddress/setup@latest update ./oneaddress-webhook
This updates a receiver the wizard set up, in place. It reads the partner id, the
signing secret and the key from the folder, so it asks for no CLI token and no secret.
A folder whose credentials are sealed asks for its passphrase only, or reads
ONEADDRESS_DB_PASSPHRASE from the environment. Running the wizard with no arguments in
such a folder offers the same update first, before anything else.
Before anything else the wizard asks the npm registry, briefly and silently offline, for
the latest version (ONEADDRESS_UPDATE_CHECK=off stops it). When there is a newer one,
the offer names it, and choosing it runs the update with that version.
An update keeps every answer you gave, and runs only the setup steps your folder has not
done: each one says which version added it, and asks only what it needs.
.oneaddress-scaffold.json records the steps a folder has done; a folder from 3.10.0 or
earlier has no record, so they are worked out from its files.
It stops the receiver running from that folder, refreshes the files the wizard owns,
keeps yours as described below, installs dependencies, starts the receiver and checks
/health. The summary names the versions it moved between, every file that changed, and
the command to go back. Your credentials file is left exactly as it was, with no .new
beside it, and oneaddress.sealed is not rewritten, so an update never makes a second
copy of a secret. If a receiver on that port cannot be traced to the folder (a container
or a service), it asks you to stop it, and without a terminal it changes nothing.
Re-running the wizard
Re-running over a folder that holds its credentials in plain text never converts it
silently: choose the sealed file and the wizard names the lines it would remove and asks.
Point it at a directory it has already written to and it updates in place. The
protocol files are refreshed; the files you own are not touched:
src/store.ts (and its per-language equivalents)
customers.json
.env
oneaddress.config.json