These examples describe the current Bijection CLI and SDK source. Use builds
from the same source commit for these APIs. The public CLI and npm SDK
are published independently and may lag this reference.
examples/openapi-crm in the prepared source checkout described in
Before you begin.
Declare the receiver
bijection/crm.ts writes the CRM as a receiver from
@bijectionhq/bijection: a subtree of targets over one shaped HTTP
API, one operation per operationId of the contract. The wire schema
cannot say what the service promises about a repeated request, so the
receiver’s contract states it: the CRM deduplicates by Idempotency-Key,
which carries the task’s once, for a day.
bijection/crm.ts
crm, so the secret’s path
is crm.token and the rename target is crm.renameCustomer. Code never holds
the token. Set it once after the first deploy:
POST at one fixed URL needs no receiver:
target({ via: http(url, { bearer }), args, returns, within }) declares it
directly. Effects covers targets and performers.
Read the accounts
Thecustomers feed of the sources library reads listCustomers from its
after cursor every minute and lands each page into the accounts table,
together with its cursor, in one commit. A list’s end proves no deletion, so
nothing is removed. The feed’s passes are the library’s own continuations,
which run as the installation under crm. Writers operate the feed
(feed.control.refresh, pause, probe); readers see its health
(feed.health.list). See crmFeed in bijection/crm.ts and the
connector catalog for packaged providers.
Continue to define customers.