Socket
Book a DemoInstallSign in
Socket

@airtop/json-schema-adapter-zod

Package Overview
Dependencies
Maintainers
8
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@airtop/json-schema-adapter-zod

Zod adapter for JSON Schema output for use with the Airtop SDK

latest
Source
npmnpm
Version
1.0.0-alpha2.2
Version published
Weekly downloads
7.1K
10.03%
Maintainers
8
Weekly downloads
 
Created
Source

Zod JSON Schema Adapter for the Airtop SDK

This schema adapter allows specifying zod objects as input when an Airtop SDK method requires a JSON schema.

Installation

npm install @airtop/sdk @airtop/json-schema-adapter-zod zod

Usage

import { AirtopClient } from "@airtop/sdk";
import { ZodJsonSchemaAdapter } from "@airtop/json-schema-adapter-zod";
import { z } from "zod";

const schema = z.object({
  results: z
    .array(
      z
        .object({
          name: z.string().describe("The name of the product"),
          description: z.string().describe("A brief description of the product's purpose"),
          benefit: z.string().describe("How the product supports developers"),
        })
        .strict(),
    )
    .optional(),
  error: z.string().min(1).describe("Error message in case of failure").optional(),
});

const client = new AirtopClient({
  outputSchemaAdapter: new ZodJsonSchemaAdapter(),
});

await client
  .withSessionId("session-id")
  .withWindowId("window-id")
  .pageQuery("title of the page", {
    configuration: {
      outputSchema: schema,
    }
  })

Keywords

airtop

FAQs

Package last updated on 18 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts