browserlayer / docsPrivate alphaDashboard ↗
Build integrationsMarkdown

Project structure

Each integration is a directory. Each executable file default-exports one definition.

text
browserlayer.config.ts
integrations/travel/
  browserlayer.json
  endpoints/
    cancel-booking.ts
  syncs/
    bookings.ts
  connector/
    references/
      booking.ts
    flows/
      authenticate.ts
      reauthenticate.ts
      list-bookings.ts
    site/
      login.ts
      bookings.ts
  models/
    booking.ts
tests/
  fixtures/
  bookings.test.ts

Register the source directory

browserlayer.config.ts:

ts
export default {
  integrations: {
    travel: { source: "integrations/travel", tests: ["tests"] },
  },
};

This selects integration directories. Functions inside them are discovered automatically.

Connection state

integrations/travel/browserlayer.json:

json
{ "connectionStateVersion": 1 }

Required when authenticate.ts exists. Increment for an incompatible change to saved connection data. This file contains no function registry.

DirectoryExportResponsibility
endpoints/createEndpointApp input/output and on-demand behavior
syncs/createSyncModel mapping, publication and schedule
connector/flows/createFlowReusable, resumable website work
connector/site/Ordinary functionsSelectors, HTTP requests, parsing
models/Zod schemasApp-facing records

Function directories are flat. Use kebab-case filenames. Renaming an endpoint or sync changes its public identity. Helpers do not need to become flows.

Use typed references when public records need stable IDs for later operations. Models remain ordinary Zod schemas.