SDK reference
Install @browserlayer/sdk to author integrations. Your backend calls the hosted HTTP API.
| API | Purpose | Example |
|---|---|---|
createEndpoint({ description, input, output, exec }) | Define an application endpoint | Endpoints |
createSync({ description, connection, schedule, model, checkpoint, exec }) | Define a scheduled dataset | Syncs |
ctx.step(id, fn) | Record a result; reuse it after a pause | Steps |
ctx.run(flow, input) | Invoke a discovered child flow | Composition |
ctx.input(id, form) | Request input and suspend | MFA |
form(schema, fields) | Declare reusable input fields | Authentication |
ctx.browser() | Obtain the Playwright page | Browser |
ctx.http.get(url, options?) | Browser-context GET | HTTP |
ctx.http.request(url, options?) | Browser-context request | HTTP |
ctx.observe(id, check, { timeoutMs }) | Poll a read-only outcome | Observation |
ctx.connection.data.get/set/delete | Saved connection data | Authentication |
ctx.getCheckpoint() | Read source progress | Checkpoints |
ctx.publish(id, records, options) | Atomically publish records and progress | Syncs |
FlowError(code, message, userMessage?) | Structured failure | Debugging |
createReference(schema) | Define private upstream identity | References |
ctx.references.store(reference, value) | Get a stable public ID | References |
ctx.references.resolve(reference, id) | Resolve private identity | References |
Additional entry points
| Import | Audience |
|---|---|
@browserlayer/sdk/testing | Integration tests |
@browserlayer/sdk/compiler | Compile an integration directory |
@browserlayer/link/browser | Optional embedded Link |
@browserlayer/sync | Webhook verification and sync storage adapters |
Low-level Runtime, MemoryStore, browser adapters and durable engine contracts are for custom hosts. See the installed SDK RUNTIME.md for their contract; they are unnecessary for the CLI workflow.
createFlow({ description, input, output, exec }) defines an internal connector operation. Only these flows can be composed with ctx.run; endpoints and syncs are entry points. All three support durable steps and user input.