bijection/
directory. Bijection then runs the sync for you: it calls the provider on a
schedule, checks every response against the contract you declared, and
publishes each page of results into your tables in one transaction.
Here is the shape of it. An integration declares a customers collection that
is read every five minutes:
bijection/crm.ts
.source(...):
bijection/schema.ts
bijection/customers.ts
bijection integration commands or the console.
Concepts
- An integration groups what Bijection needs to know about one external system: the HTTP requests it may make, the collections it reads and the commands it can send.
- A collection is one kind of record the provider holds, such as customers or invoices. Each collection declares its schema, what the provider’s responses prove about it, and its sync: how often it is read and how a response becomes records.
- A synced table is a table bound to a collection with
.source(...). Only the sync writes to it. Your mutations cannot. - A connection installs an integration against one verified provider account in one deployment, with a private credential that your functions never see.
Kinds of integrations
defineIntegrationdeclares an integration over a provider’s HTTP API. Your code maps responses to records.definePostgresIntegrationreplicates selected PostgreSQL tables through logical replication.defineMailIntegrationreads an IMAP mailbox.
Sending changes back to a provider is done with integration commands, which
your code requests as durable external calls. See
Operations.
Defining integrations
Declare requests, collections, syncs and commands with
defineIntegration.Synced tables
Bind tables to collections and read synced data in your functions.
Connecting and syncing
Provide credentials, verify the account, install sources and follow syncs.
PostgreSQL
Replicate PostgreSQL tables with change data capture.
Sync messages, contents and folders from an IMAP mailbox.
Listeners and webhooks
Refresh a collection as soon as the provider notifies you.
CLI reference
Every
bijection integration subcommand.