# Sync records A sync reads website data on a schedule and publishes records your app can consume. `integrations/atlas-demo/syncs/bookings.ts`: ```ts import { randomUUID } from "node:crypto"; import { createSync } from "@browserlayer/sdk"; import { z } from "zod"; import listBookings from "../connector/flows/list-bookings.js"; import { publicBookings } from "../models/bookings.js"; import { Booking } from "../models/booking.js"; export default createSync({ description: "Keep the application's bookings current, including cancellations and deletions.", connection: "required", schedule: "every 30 seconds", model: Booking, checkpoint: z.null(), async exec(ctx) { const scan = await ctx.step("scan", async () => randomUUID()); const source = await ctx.run(listBookings, {}); const records = await publicBookings(ctx, source); await ctx.publish("snapshot", records, { checkpoint: null, scan, completeScan: true, }); }, }); ``` This example publishes a complete snapshot. The connector and model are supplied by the [Atlas tutorial](/docs/atlas). ## Inspect and control locally ```sh browserlayer syncs list --local browserlayer syncs trigger bookings --local browserlayer syncs records bookings --local browserlayer syncs pause bookings --local browserlayer syncs start bookings --local ``` Keep `browserlayer start` running. Connected accounts get schedules automatically. Waiting runs prevent overlap. `pause` prevents the next occurrence; it does not cancel the current run. `trigger` enables the schedule and makes it due now. Use the same commands with `--env development` after deploying. | Option | Required | Example | | ------------ | -------- | -------------------------------------- | | `connection` | Yes | `"required"` | | `schedule` | Yes | `"every 5 minutes"` | | `model` | Yes | Zod object with string `id` | | `checkpoint` | Yes | `z.null()` or a source progress schema | **Next:** [Checkpoints and deletions](/docs/checkpoints), then [consume records](/docs/records).