npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@u-krupaveho-kraba/form-schemas

v0.3.0

Published

Zod schemas for Topol form JSON (validation gate + AI generation)

Readme

@topol/form-schemas

Zod v4 schemas for the Topol form JSON model: forms, steps, elements, and the Campaign/Variant/targeting/trigger contract used for popup targeting and A/B testing. Built on zod/mini for a smaller runtime footprint.

Install

npm install @topol/form-schemas zod

zod (^4.1.11) is a peer dependency, not bundled.

What's in here

  • Form schemasFormSchema, StepSchema, FormElementSchema, and the per-element-type property schemas, describing the full form JSON tree rendered by the Topol form widget.
  • Campaign schemasCampaignItemSchema, VariantSchema, CampaignTargetingSchema, TriggerConditionSchema, and CampaignItemsFileSchema, describing one independently-evaluated CampaignItem's targeting rules, display trigger, and A/B variants (there is no Campaign wrapper -- CampaignItem is the atomic authored/published unit, ADR 0025).

Usage

import { CampaignItemSchema } from "@topol/form-schemas";

const result = CampaignItemSchema.safeParse(payload);
if (!result.success) {
  // result.error describes exactly which field failed and why
}

Generating JSON Schema

Both schema families can be serialized to standard JSON Schema (draft 2020-12), for validating payloads from non-TypeScript consumers or for feeding an LLM the exact shape of valid JSON:

import { getFormJsonSchema, getCampaignItemJsonSchema } from "@topol/form-schemas";

const formSchema = getFormJsonSchema();
const campaignItemSchema = getCampaignItemJsonSchema();

The generated CampaignItem JSON Schema also ships pre-built in the package at schema/campaignItem.schema.json, so non-TypeScript consumers (e.g. a backend service in another language) can validate against the exact same contract without needing to run TypeScript or zod themselves.

Versioning

This package's semver is independent from the version/formatVersion fields inside the campaign/form JSON payloads themselves. Those in-payload fields describe wire-format migration compatibility at runtime; this package's version describes the TypeScript contract's own API compatibility. A bump in one doesn't imply a bump in the other.

Source

Part of the Topol editors monorepo, which is a private repository — the repository field above won't resolve for external visitors. This package is published publicly because its contents (schema shapes, no business logic or credentials) are safe to distribute even though the source repo isn't.