Skip to main content
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.
Begin in 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
The tree places the token and the operations at 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:
A service that takes one JSON 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

The customers 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.