Packages

Schema

Shared schema for profiles, collections, entries, and webhooks.

@scrape-admin/schema defines the Zod schemas and inferred TypeScript types shared across the Scrape Admin apps and packages. It has no runtime dependencies on any single app, so the web app, coordinator, and profile-runner can all validate the same shapes.

Profile schema

zProfile and zProfileElement describe a scraping profile: the URL to load, settings, and the elements to extract. They are consumed by profile-runner to run profiles, and by the web app to validate profiles stored on collections and entries.

import { zProfile } from '@scrape-admin/schema'

const profile = zProfile.parse({
  url: 'https://example.com',
  elements: [
    { type: 'attribute', name: 'title', selector: 'h1', resultSelector: '0.text' },
  ],
})

zAction describes the actions (code, waitForElement, and others) that can run before or after an element is extracted — see Profile Runner for the full list supported at runtime.

Webhook schema

zWebhook and zWebhookDestination describe a webhook call: its URL, HTTP method, headers, optional bearer token, retry attempts, and body. zWebhookDestination (the schema without a body) is reused by @scrape-admin/web-schema for a collection entry's destinations, and by @scrape-admin/coordinator-schema for a scheduled webhook's destinations — so both apps validate destinations the same way.

import { zWebhookDestination } from '@scrape-admin/schema'

const destination = zWebhookDestination.parse({
  url: 'https://example.com/hooks/scrape-complete',
  method: 'POST',
  token: 'secret-token',
})

Types

Every schema exports an inferred type alongside it, for example Webhook and WebhookDestination for zWebhook and zWebhookDestination. Prefer importing the inferred type rather than redeclaring the shape elsewhere, so schema changes are caught by the type checker.

Copyright © 2026