browserlayer / docsPrivate alphaDashboard ↗
ReferenceMarkdown

SDK reference

Install @browserlayer/sdk to author integrations. Your backend calls the hosted HTTP API.

APIPurposeExample
createEndpoint({ description, input, output, exec })Define an application endpointEndpoints
createSync({ description, connection, schedule, model, checkpoint, exec })Define a scheduled datasetSyncs
ctx.step(id, fn)Record a result; reuse it after a pauseSteps
ctx.run(flow, input)Invoke a discovered child flowComposition
ctx.input(id, form)Request input and suspendMFA
form(schema, fields)Declare reusable input fieldsAuthentication
ctx.browser()Obtain the Playwright pageBrowser
ctx.http.get(url, options?)Browser-context GETHTTP
ctx.http.request(url, options?)Browser-context requestHTTP
ctx.observe(id, check, { timeoutMs })Poll a read-only outcomeObservation
ctx.connection.data.get/set/deleteSaved connection dataAuthentication
ctx.getCheckpoint()Read source progressCheckpoints
ctx.publish(id, records, options)Atomically publish records and progressSyncs
FlowError(code, message, userMessage?)Structured failureDebugging
createReference(schema)Define private upstream identityReferences
ctx.references.store(reference, value)Get a stable public IDReferences
ctx.references.resolve(reference, id)Resolve private identityReferences

Additional entry points

ImportAudience
@browserlayer/sdk/testingIntegration tests
@browserlayer/sdk/compilerCompile an integration directory
@browserlayer/link/browserOptional embedded Link
@browserlayer/syncWebhook 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.