open-index/open-npm huggingface dataset:
npm package: @schema-forms-data/core
Description: Core types, enums and utilities for SchemaForms — zero runtime dependencies, pure TypeScript
Author: SchemaForms
Latest version: 4.0.7

# @schema-forms-data/core

[![npm](https://img.shields.io/npm/v/@schema-forms-data/core)](https://www.npmjs.com/package/@schema-forms-data/core)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](../../LICENSE)

Core types, enums and utilities for SchemaForms. **Zero runtime dependencies** — pure TypeScript.

## Install

```bash
npm install @schema-forms-data/core
```

## Main exports

### `FormSchema`

The top-level type for a complete form definition:

```ts
import type { FormSchema, FieldType } from "@schema-forms-data/core";

const schema: FormSchema = {
  id: "my-form",
  title: "My Form",
  steps: [
    {
      id: "step-1",
      title: "Personal info",
      containers: [
        {
          id: "container-1",
          columns: 2,
          fields: [
            {
              id: "name",
              fieldType: "texto",
              label: "Full name",
              required: true,
            },
          ],
        },
      ],
    },
  ],
};
```

### `FieldType` enum values

| Value                      | Description                       |
| -------------------------- | --------------------------------- |
| `texto`                    | Single-line text input            |
| `textarea`                 | Multi-line text area              |
| `email`                    | Email input                       |
| `select`                   | Dropdown select                   |
| `radio`                    | Radio group                       |
| `checkbox`                 | Single checkbox                   |
| `checkbox_group`           | Multiple checkboxes               |
| `date`                     | Date picker                       |
| `cpf` / `telefone` / `cep` | Masked inputs                     |
| `file`                     | File upload                       |
| `field_array`              | Repeatable group of fields        |
| `terms`                    | PDF terms acceptance              |
| `participation_type`       | Business: participation modality  |
| `payment_method`           | Business: payment method selector |
| `hidden`                   | Hidden field                      |

### `generateId()`

```ts
import { generateId } from "@schema-forms-data/core";

const id = generateId(); // "a1b2c3d4-..."
```

## License

MIT © [SchemaFormsData](https://github.com/SchemaFormsData)
npm package: @schema-forms-data/create
Description: Scaffold a SchemaForms studio app — builder + JSON viewer + renderer preview
Author: SchemaForms
Latest version: 4.0.7

# create-schema-form

Scaffold a **SchemaForms Studio** — a Vite + React app with a drag-and-drop form builder, live JSON viewer, and form preview — in one command.

## Usage

```bash
npx create-schema-form my-app
cd my-app
npm install
npm run dev
```

Then open **http://localhost:5173**.

## What you get

```
my-app/
├── src/
│   ├── App.tsx           ← Studio shell (builder + JSON + preview)
│   ├── exampleSchema.ts  ← Starter FormSchema — edit or replace
│   ├── App.css
│   ├── index.css
│   └── main.tsx
├── index.html
├── vite.config.ts
├── tsconfig.json
└── package.json
```

### Studio layout

```
┌─────────────────────────────────────────────────────────────────────┐
│  SchemaForms Studio                         [JSON] [Preview]  Save  │
├──────────────┬───────────────────────┬──────────────┬───────────────┤
│   Palette    │       Canvas          │   Config     │  JSON / Form  │
│              │  drag fields here     │   Panel      │  Preview      │
└──────────────┴───────────────────────┴──────────────┴───────────────┘
```

- **Palette** — drag field types onto the canvas
- **Canvas** — build multi-step forms visually (Step → Container → Fields)
- **Config Panel** — configure the selected field
- **JSON** — see the live `FormSchema` JSON; click **Copy** to grab it
- **Preview** — actually fill in the form and see the submitted data

Click **Save / Export** to convert the current canvas state to a `FormSchema` and update both panels. The schema is also saved to `localStorage` so it survives a page refresh.

## Packages installed

| Package                       | Role                                                  |
| ----------------------------- | ----------------------------------------------------- |
| `@schema-forms-data/core`     | TypeScript types & enums                              |
| `@schema-forms-data/builder`  | `BuilderProvider`, `Canvas`, `Palette`, `ConfigPanel` |
| `@schema-forms-data/renderer` | `FormRenderer`                                        |

## Docs

https://schemaformsdata.github.io/schema-forms-data
npm package: @schema-forms-data/react
Description: All-in-one re-export: @schema-forms-data/core + templates + renderer + builder
Author: SchemaForms
Latest version: 4.0.7

# @schema-forms-data/react

[![npm](https://img.shields.io/npm/v/@schema-forms-data/react)](https://www.npmjs.com/package/@schema-forms-data/react)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](../../LICENSE)

**Meta-package** — re-exports everything from all SchemaForms packages in one install.

## Install

```bash
npm install @schema-forms-data/react react-hook-form lucide-react
```

## Usage

```tsx
// Instead of installing 4 separate packages:
import { FormRenderer, BuilderProvider, Canvas } from "@schema-forms-data/react";
import type { FormSchema, FieldType } from "@schema-forms-data/react";
```

This package re-exports from:

- `@schema-forms-data/core` — types, enums, utilities
- `@schema-forms-data/templates` — TemplateProvider, template registry, preset blocks
- `@schema-forms-data/renderer` — FormRenderer, RendererContext
- `@schema-forms-data/builder` — BuilderProvider, Canvas, ConfigPanel, Palette

## When to use individual packages instead

Use individual packages when:

- You only need the **renderer** (smaller bundle, no `@dnd-kit` in the output)
- You only need the **builder** (no react-hook-form required)
- You're building a micro-frontend and need fine-grained control

## License

MIT © [SchemaFormsData](https://github.com/SchemaFormsData)
npm package: @schema-forms-data/templates
Description: Template registry and preset blocks for SchemaForms
Author: SchemaForms
Latest version: 4.0.7

# @schema-forms-data/templates

[![npm](https://img.shields.io/npm/v/@schema-forms-data/templates)](https://www.npmjs.com/package/@schema-forms-data/templates)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](../../LICENSE)

Visual templates, CSS variable injection and preset field blocks for SchemaForms.

## Install

```bash
npm install @schema-forms-data/templates @schema-forms-data/core
```

## TemplateProvider

Wraps your form and injects CSS custom properties (`--t-primary`, `--t-bg`, etc.) based on the chosen template:

```tsx
import { TemplateProvider } from "@schema-forms-data/templates";

<TemplateProvider template="moderno">
  {/* your form goes here */}
</TemplateProvider>;
```

## Available templates

| Key             | Style                                 |
| --------------- | ------------------------------------- |
| `moderno`       | Clean, white background, blue primary |
| `escuro`        | Dark surface, light text              |
| `oceano`        | Deep blue gradient                    |
| `floresta`      | Green tones                           |
| `coral`         | Warm coral/salmon                     |
| `aurora`        | Purple-pink gradient                  |
| `glassmorphism` | Frosted glass effect                  |
| `minimalista`   | Ultra-clean minimal                   |
| …and more       | See `TEMPLATE_REGISTRY`               |

```ts
import { getAllTemplates, getTemplateConfig } from "@schema-forms-data/templates";

const all = getAllTemplates(); // [{ key, name, ... }, ...]
const config = getTemplateConfig("escuro");
```

## Preset blocks

Pre-configured groups of fields to quickly scaffold common form sections:

```ts
import { PRESET_BLOCKS, getPresetById } from "@schema-forms-data/templates";

const personalBlock = getPresetById("preset_personal");
// Returns: PresetBlock with fields for nome, email, cpf, data_nascimento, etc.
```

Available presets: `preset_personal`, `preset_address`, `preset_emergency`, `preset_health`, `preset_responsible`, `preset_participation`, `preset_payment`.

## License

MIT © [SchemaFormsData](https://github.com/SchemaFormsData)
npm package: @schema-kit/common
Description: Common types for Schema Kit
Author: Sean Marvi Oliver Genabe
Latest version: 1.5.0

# Common types for Schema Kit

## Usage

```typescript
import {
  boolean,
  integer,
  buildNull,
  number,
  object,
  optional,
  string,
} from "@schema-kit/common"
```

A description of each type can be found on [the wiki](https://gitlab.com/seangenabe/schema-kit/-/wikis/Schema-Kit-types).

### Common options

* title: Optional.
* description: Optional.

### never(opts)

Creates a never node.

### any(opts)

Creates an any node.

### buildConst(value, opts)

Creates a const node.

Parameters:
* value: A constant value.

### buildNull(opts)

Creates a null node.

### boolean(opts)

Creates a boolean node.

### integer(opts)

Creates an integer node. 

### number(opts)

Creates a number node.

### object(properties, opts)

Creates an object node.

Parameters:
* properties: A key-value object containing string keys and their corresponding schema nodes.

### optional(child, opts)

Creates an optional node.

Parameters:
* child: The child schema node. The child node cannot be another optional node.

### array(child, opts)

Creates an array node.

Parameters:
* child: The child schema node.

### union(children, opts)

Creates a union node.

Parameters:
* children: An array of the children schema nodes.
npm package: @schema-kit/json-schema
Description: Generate JSON Schema using Schema Kit
Author: Sean Marvi Oliver Genabe
Latest version: 1.5.0

# JSON Schema transform for Schema Kit

## About Schema Kit

Schema Kit allows you to create a meta-schema that can be transformed into
TypeScript, JSON Schema, and more.

## Usage

| Schema Kit           | JSON Schema
| -------------------- | -----------------------------------------
| `never()`            | `false`
| `any()`              | `{}`
| `buildConst(value)`  | `{ const: value }`
| `buildNull()`        | `null`
| `boolean()`          | `{ type: "boolean" }`
| `number()`           | `{ type: "number" }`
| `integer()`          | `{ type: "integer" }`
| `string()`           | `{ type: "string" }`
| `stringEnum(values)` | `{ type: "string", enum: values }`
| `optional(schema)`   | excluded from `required` array
| `object(props)`      | `{ type: "object", properties: { ... } }`
| `array(schema)`      | `{ type: "array", items: schema }`
| `union(schemas)`     | `{ anyOf: schemas }`

Optional nodes only make sense in the context of object node property values.

For `const`, the appropriate `type` will be included if the value is `null`, a boolean, a number, a string, or an array.

```typescript
import { toJsonSchema } from "@schema-kit/json-schema"
```

### toJsonSchema(schema)

Converts the input schema into JSON Schema.

Parameters:
* `schema` - The input schema.

Returns: `false | object` - The output JSON Schema.

## Options

The Schema Kit schema builders can be passed an optional options object to further describe their schema.

Check the JSON Schema documentation for information on how to use these options.

### Common options

* title
* description
* default
* examples
* raw - Merges an object into the schema.

### Numeric: number and integer

* multipleOf
* minimum
* maximum
* exclusiveMinimum
* exclusiveMaximum

### string

* minLength
* maxLength
* pattern
* format

### array

* minLength
* maxLength
* uniqueItems
npm package: @schema-kit/tscodegen
Description: Generate TypeScript code using Schema Kit
Author: Sean Marvi Oliver Genabe
Latest version: 1.5.0

# TypeScript code generator for Schema Kit

## About Schema Kit

Schema Kit allows you to create a meta-schema that can be transformed into
TypeScript, JSON Schema, and more.

## Usage

| Schema Kit           | TypeScript
| -------------------- | ----------------------------
| `never()`            | `never`
| `any()`              | `any`
| `buildConst(value)`  | `type Title = value`
| `buildNull()`        | `null`
| `boolean()`          | `boolean`
| `number()`           | `number`
| `integer()`          | `number`
| `string()`           | `string`
| `stringEnum(values)` | `enum Title {}`
| `optional(schema)`   | Union with `undefined`. Optional property if inside an object.
| `object(props)`      | `interface Title {}`
| `array(schema)`      | `T[]`
| `union(schemas)`     | The union of the schemas

```typescript
import { toTypescriptCode } from "@schema-kit/tscodegen"
```

### toTypescriptCode(schema, opts)

```typescript
function toTypescriptCode<O extends BaseSchema>(
  schema: Schema<O>,
  opts: ToTypescriptCodeOptions<O>
): string
```

Converts the input schema into TypeScript code.

Type parameters:
* `O` - User-defined schema types.

Parameters:
* `schema: Schema<O>` - The input schema.
* `opts: ToTypescriptCodeOptions<O> = { prettier: { filepath: "file.ts" } }`
  * `prettier?: prettier.Options` - Options to pass to Prettier
  * `overrideResolvers?(defaultResolvers)` - Override the resolvers used.

Returns: `string` - The output TypeScript code.

Technical limitation: Currently all object and stringEnum schemas generate
interfaces and enums. Interfaces and enums without a title are given a
deterministically-generated ID prefixed with `__`.

#### overrideResolvers

Useful if you want to override the resolvers used to resolve types,
e.g. if you have a custom node type.
The function takes the key-value object of default resolvers.
You must return a similarly-typed object with your own resolvers.
Do not mutate the set of default resolvers!
npm package: @schema-kit/typescript
Description: Create TypeScript types using Schema Kit
Author: Sean Marvi Oliver Genabe
Latest version: 1.5.0

# TypeScript type creator for Schema Kit

## About Schema Kit

Schema Kit allows you to create a meta-schema that can be transformed into
TypeScript, JSON Schema, and more.

## Usage

For when you're feeling too lazy to use @schema-kit/tscodegen. 😆

| Schema Kit           | TypeScript
| -------------------- | ----------------------------
| `never()`            | `never`
| `any()`              | `any`
| `buildConst(value)`  | The type of the value
| `buildNull()`        | `null`
| `boolean()`          | `boolean`
| `number()`           | `number`
| `integer()`          | `number`
| `string()`           | `string`
| `stringEnum(values)` | `T[number]`
| `optional(schema)`   | Union with `undefined`
| `object(props)`      | Object with the appropriate optional and required properties
| `array(schema)`      | `T[]`
| `union(schemas)`     | The union of the schemas

```typescript
import { toTypescriptCode } from "@schema-kit/tscodegen"
```

### ToTypescriptType<Schema>

```typescript
type ToTypescriptType<Schema>
```

Converts the type of the input schema into a TypeScript type.

Type parameters:
* `Schema` - The input schema.

Usage:

```typescript
const schema = buildNull()
type NullType = ToTypescriptType<typeof schema>
```
npm package: @schema-plugin-flow/sifo-mplg-drag
Description: sifo drag model plugin. 拖拽搭建模型插件
Author: FrominXu
Latest version: 1.6.0

# SifoDragModelPlugin

Sifo 拖拽模型插件，在以任意组件与初始 Schema 渲染的基础上，支持对组件进行即时拖拽，构建出新的 Schema.

### 设计器 props:
* id: 设计器节点id
* instanceId: sifoApp 实例id
* onDragStart: 拖入添加时调用，参数是节点数据 (newNode)=> bool;
* onDragEnd: 拖入动作结束时调用
* updateAttributes: 更新节点属性，(id, attributes, needReload = false) => {
* updateId: 更新节点id，(id, newId) => void;
* replaceComponent: 更新节点组件，(id, componentName, needReload = false) => void;
* deleteNode: 删除指定节点，id=>void;
* addChildNode: 添加子节点，(newNode, targetId) => bool;
* getSchema: 获取编辑后的schema，等效于 () => this.mApi.getEditedSchema(),
* getNodeInfo: 获取指定节点信息，id => info;
* getDomById: 获取指定节点的DOM，id => Dom;
* setSelectedId: 设置选中的节点id;

具体请参照 sifo-mplg-drag-react 和 sifo-mplg-drag-vue.
npm package: @schema-plugin-flow/sifo-mplg-react-optimize
Description: React rendering optimize for sifo-react.
Author: FrominXu
Latest version: 1.3.0

# SifoReactOptimizeModelPlugin

sifo-react-optimize-model-plugin 

react渲染优化的sifo-model modelPlugin模型插件
> `sifo-react` is 'top-down' rendering type, you can use the modelPlugin  `@schema-plugin-flow/sifo-mplg-react-optimize` to optimize the rerendering in complex project.

*In general, you should use it as the last one in the plugins list.*

codesandbox.io: [sifo-react-mplg-optimize](https://codesandbox.io/s/sifo-react-mplg-optimize-sfmts) 

代码示例

```javascript
import SifoModel from '@schema-plugin-flow/sifo-model';
//
const plugins = [..., { modelPlugin: reactOptimizeModelPlugin }];
new SifoModel(
  namespace,
  refreshApi,
  schema,
  plugins
);
```
## 扩展的 mApi 模型接口

*mApi说明*

| 方法名            | 参数/类型               | 返回值类型             | 描述       |
| ---------------- | -----------------------| --------------------- | ---------------------------------------------------------------------------------------------------|
| forceRefresh     | ✘                      |   -            |    mApi的setAttributes和refresh是按标记刷新渲染，调用此方法将强制全部刷新   |

## attributes

| 属性名            | 类型               | 默认值             | 描述       |
| ---------------- | -----------------------| --------------------- | ---------------------------------------------------------------------------------------------------|
| muteRenderOptimizeMark     | bool            |       false        |    当节点上此属性为true时，该节点不受渲染优化标记的控制，按照普通渲染模式渲染，但仍然受父组件的渲染与否影响   |
 

## 其它
此模型插件是通过扩展sifo-model的setAttributes方法实现的。
npm package: @schema-plugin-flow/sifo-singleton
Description: sifo singleton
Author: FrominXu
Latest version: 1.2.0

# sifo-singleton

 这是一个全局单例容器，用于注册插件与组件，以命名空间区分。

## SifoSingleton 类

*SifoSingleton实例化参数*

参数          | 说明        | 类型 | 是否必传 | 默认值
-------------|-------------|-----|-----|-----
namespace    | 命名空间，插件与组件通过同一命名空间读取 | string | 是 | - |


## 方法

| 方法名                 | 参数/类型            | 返回值类型             | 描述         |
| --------------------- | -------------------| --------------------- | ---------------------------------------------------------------------------------------------------|
| registerItem          | (id: string, item: function)  | -          | 注册对象      |
| getRegisteredItems    | ()                   | array               | 获取所有的命名空间下的注册对象   |

> 代码示例-注册
```javascript
import SifoSingleton from '@schema-plugin-flow/sifo-singleton';
const singleton = new SifoSingleton('test');
singleton.registerItem('extendId01', (params) => {
  return {
    version: '1.0.0',
    plugins: [
      {
        componentPlugin: singleton_comp_plg,
        pagePlugin: {}
      }, 
      {
        pagePlugin: {
          onPageInitial: params => {
            console.log('singleton1 page plugin')
          }
        }
      }
    ],
    components: {
      test: TestComp
    }
  }
});
```

> 代码示例-取出
```javascript
import SifoSingleton from '@schema-plugin-flow/sifo-singleton';
const singleton = new SifoSingleton('test');
const singletonItems = singleton.getRegisteredItems({ param1: 'testssss' });
singletonItems.forEach(registerItem => {
    const { components = {}, plugins = [] } = registerItem;
});
```
npm package: @schemacompany/cli
Description: CLI for injecting JSON-LD schemas into HTML files
Latest version: 0.1.1

# @schemacompany/cli

CLI for injecting JSON-LD schemas into static HTML files at build time.

## Installation

```bash
npm install -D @schemacompany/cli
```

## Usage

### Using a Configuration File

Create a `schemas.json` file:

```json
{
  "baseUrl": "https://assets.theschemacompany.com",
  "pages": [
    { "path": "index.html", "hash": "your-64-char-hash..." },
    { "path": "about/index.html", "hash": "another-hash..." },
    { "glob": "products/**/*.html", "hash": "product-schema-hash..." }
  ],
  "options": {
    "position": "head-end",
    "pretty": true
  }
}
```

Run the inject command:

```bash
npx schemacompany inject ./dist --config schemas.json
```

### Using CLI Options

```bash
npx schemacompany inject ./dist --hash abc123... --pages "index.html,about.html"
```

### Validate Configuration

```bash
npx schemacompany validate --config schemas.json
```

## Commands

### `inject <directory>`

Inject schemas into HTML files.

| Option | Description | Default |
|--------|-------------|---------|
| `-c, --config <path>` | Config file path | `schemas.json` |
| `-h, --hash <hash>` | Single hash to inject | - |
| `-p, --pages <pages>` | Comma-separated page paths | - |
| `--base-url <url>` | Override base URL | Production |
| `--position <pos>` | Injection position | `head-end` |
| `--dry-run` | Show changes without writing | `false` |
| `-v, --verbose` | Verbose output | `false` |

Position options: `head-start`, `head-end`, `body-end`

### `validate`

Validate a configuration file.

| Option | Description | Default |
|--------|-------------|---------|
| `-c, --config <path>` | Config file path | `schemas.json` |

## Configuration Schema

```typescript
interface Config {
  baseUrl?: string;
  pages: Array<
    | { path: string; hash: string }
    | { glob: string; hash: string }
  >;
  options?: {
    position?: "head-start" | "head-end" | "body-end";
    pretty?: boolean;
  };
}
```

## License

MIT
npm package: @schemacompany/cloudflare
Description: Cloudflare Worker for edge-side schema injection
Latest version: 0.1.1

# @schemacompany/cloudflare

Cloudflare Worker for edge-side JSON-LD schema injection.

## One-Click Deploy

Deploy this worker instantly to your Cloudflare account:

[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/theschemacompany/sdks/tree/main/templates/cloudflare-schema-injector)

## Installation

For manual setup or integration into existing projects:

```bash
npm install @schemacompany/cloudflare
```

## Usage

### Basic Setup

```typescript
// src/index.ts
import schemaInjector from "@schemacompany/cloudflare";
export default schemaInjector;
```

### Configuration

Configure via `wrangler.jsonc`:

```jsonc
{
  "name": "schema-injector",
  "main": "src/index.ts",
  "compatibility_date": "2024-01-01",
  "vars": {
    "SCHEMA_BASE_URL": "https://assets.theschemacompany.com",
    "SCHEMA_MAPPINGS": "{\"/\":\"homepage-hash\",\"/about\":\"about-hash\"}"
  }
}
```

## Configuration Methods

The worker determines which schema to inject using these methods (in order):

### 1. Response Header

Set `X-Schema-Hash` header from your origin:

```
X-Schema-Hash: your-64-char-hash...
```

### 2. Path Mapping

Configure `SCHEMA_MAPPINGS` environment variable:

```json
{
  "/": "homepage-hash",
  "/about": "about-hash",
  "/products/*": "products-hash",
  "/*": "fallback-hash"
}
```

Supports exact paths, prefix matching (`/*`), and catch-all.

### 3. Meta Tag

Add a meta tag to your HTML:

```html
<meta name="schema-hash" content="your-64-char-hash...">
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `SCHEMA_BASE_URL` | API base URL | Production URL |
| `SCHEMA_MAPPINGS` | JSON path-to-hash mapping | `{}` |

## Exports

```typescript
import schemaInjector, {
  type Env,
  injectSchema,
  extractMetaSchemaHash,
  getBaseUrl,
  getPathMappings,
  getSchemaHashFromMappings,
} from "@schemacompany/cloudflare";
```

## License

MIT
npm package: @schemacompany/core
Description: Core utilities for The Schema Company SDKs
Latest version: 0.1.1

# @schemacompany/core

Core utilities for The Schema Company SDKs. This package provides the base client, types, and error handling used by all other SDK packages.

## Installation

```bash
npm install @schemacompany/core
```

## Usage

```typescript
import { SchemaClient } from "@schemacompany/core";

const client = new SchemaClient();

// Fetch a schema by hash
const schema = await client.fetchSchema("a1b2c3d4...");
console.log(schema);
// { "@context": "https://schema.org", "@type": "WebPage", ... }

// Fetch as raw JSON string
const raw = await client.fetchSchemaRaw("a1b2c3d4...");
console.log(raw);
// '{"@context":"https://schema.org",...}'

// Validate a hash format
const isValid = client.validateHash("a1b2c3d4...");
```

## API

### `SchemaClient`

```typescript
class SchemaClient {
  constructor(config?: SchemaCompanyConfig);
  fetchSchema(hash: string): Promise<Schema>;
  fetchSchemaRaw(hash: string): Promise<string>;
  validateHash(hash: string): boolean;
}
```

### `SchemaCompanyConfig`

```typescript
interface SchemaCompanyConfig {
  baseUrl?: string;  // Default: https://assets.theschemacompany.com
  timeout?: number;  // Default: 5000ms
}
```

### Error Classes

- `SchemaCompanyError` - Base error class
- `SchemaNotFoundError` - Thrown when schema hash is not found (404)
- `SchemaFetchError` - Thrown on network or parse errors
- `InvalidHashError` - Thrown when hash format is invalid

## Constants

```typescript
import { DEFAULT_BASE_URL, HASH_REGEX } from "@schemacompany/core";

// DEFAULT_BASE_URL: "https://assets.theschemacompany.com"
// HASH_REGEX: /^[a-f0-9]{64}$/i
```

## License

MIT
npm package: @schemacompany/next
Description: Next.js SDK for The Schema Company
Latest version: 0.1.1

# @schemacompany/next

Next.js SDK for The Schema Company. Supports both App Router (Server Components) and Pages Router.

## Installation

```bash
npm install @schemacompany/next
```

## App Router Usage

### SchemaScript Component

Use the `SchemaScript` async server component to automatically fetch and inject schemas:

```tsx
// app/page.tsx
import { SchemaScript } from "@schemacompany/next";

export default function Page() {
  return (
    <>
      <SchemaScript hash="your-64-char-hash..." />
      <main>Your page content</main>
    </>
  );
}
```

### fetchSchema Helper

For use in `generateMetadata` or other server contexts:

```tsx
import { fetchSchema } from "@schemacompany/next";

export async function generateMetadata() {
  const schema = await fetchSchema("your-hash...");
  // Use schema data for metadata
}
```

## Pages Router Usage

### getStaticSchema / getSchema

```tsx
// pages/index.tsx
import { getStaticSchema, SchemaHead } from "@schemacompany/next";
import Head from "next/head";

export async function getStaticProps() {
  const { schema, revalidate } = await getStaticSchema({ hash: "your-hash..." });
  return { props: { schema }, revalidate };
}

export default function Page({ schema }) {
  return (
    <>
      <Head>
        <SchemaHead schema={schema} />
      </Head>
      <main>Your content</main>
    </>
  );
}
```

For SSR, use `getSchema` instead:

```tsx
export async function getServerSideProps() {
  const schema = await getSchema({ hash: "your-hash..." });
  return { props: { schema } };
}
```

## API

### App Router

- `SchemaScript({ hash, baseUrl? })` - Server component that fetches and renders the schema
- `fetchSchema(hash, baseUrl?)` - Async function to fetch schema data

### Pages Router

- `getSchema({ hash, baseUrl? })` - Fetch schema for SSR
- `getStaticSchema({ hash, baseUrl? })` - Fetch schema for SSG with revalidation
- `SchemaHead({ schema })` - Component to render schema in `<Head>`

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `hash` | `string` | required | 64-character hex hash |
| `baseUrl` | `string` | Production URL | Override API base URL |

## License

MIT
npm package: @schemacompany/vite
Description: Vite plugin for build-time schema injection
Latest version: 0.1.1

# @schemacompany/vite

Vite plugin for build-time JSON-LD schema injection.

## Installation

```bash
npm install -D @schemacompany/vite
```

## Usage

### Basic Configuration

```typescript
// vite.config.ts
import { defineConfig } from "vite";
import { schemaCompany } from "@schemacompany/vite";

export default defineConfig({
  plugins: [
    schemaCompany({
      schemas: {
        "/": "homepage-64-char-hash...",
        "/about": "about-page-hash...",
      },
    }),
  ],
});
```

### Using a Configuration File

```typescript
// vite.config.ts
import { defineConfig } from "vite";
import { schemaCompany } from "@schemacompany/vite";

export default defineConfig({
  plugins: [
    schemaCompany({
      configFile: "./schemas.json",
    }),
  ],
});
```

Configuration file format:

```json
{
  "pages": [
    { "path": "/", "hash": "homepage-hash..." },
    { "path": "/about", "hash": "about-hash..." }
  ]
}
```

## Options

```typescript
interface SchemaCompanyPluginOptions {
  schemas?: Record<string, string>;  // Path to hash mapping
  configFile?: string;               // Path to JSON config file
  baseUrl?: string;                  // Override API base URL
  position?: "head-start" | "head-end" | "body-end";  // Default: "head-end"
}
```

## How It Works

1. During `buildStart`, the plugin fetches all schemas from the API
2. Schemas are cached in memory
3. During HTML transformation, schemas are injected into the appropriate pages
4. Works with multi-page Vite applications

## License

MIT
npm package: @schemasentry/core
Description: Typed schema builders and validation primitives for Schema Sentry.
Latest version: 0.11.0

# @schemasentry/core

Type-safe schema builders and validation primitives for Schema Sentry.

## Install

```bash
pnpm add @schemasentry/core
npm install @schemasentry/core
```

## Features

- **Type-safe builders** for 13+ schema types
- **Deterministic JSON-LD** output
- **Validation engine** with required/recommended field checks
- **Zero runtime dependencies**

## Usage

```typescript
import { Article, Organization, validateSchema } from "@schemasentry/core";

const article = Article({
  headline: "My Article",
  authorName: "John Doe",
  datePublished: "2026-02-11",
  url: "https://example.com/blog/my-article"
});

const result = validateSchema([article]);
if (!result.ok) {
  console.log(result.issues);
}
```

## Supported Schema Types

- Organization, Person, Place, LocalBusiness
- WebSite, WebPage
- Article, BlogPosting
- Product
- FAQPage, HowTo
- BreadcrumbList
- Event, Review
- VideoObject, ImageObject

## Documentation

See [Schema Sentry Docs](https://github.com/arindamdawn/schema-sentry#readme)
npm package: @schemasentry/next
Description: Next.js App Router bindings for Schema Sentry.
Latest version: 0.11.0

# @schemasentry/next

Next.js App Router `<Schema />` component for Schema Sentry.

## Install

```bash
pnpm add @schemasentry/next @schemasentry/core
npm install @schemasentry/next @schemasentry/core
```

## Usage

```tsx
import { Schema, Article, Organization } from "@schemasentry/next";

export default function BlogPost() {
  const org = Organization({
    name: "Acme Corp",
    url: "https://acme.com"
  });

  const article = Article({
    headline: "My Article",
    authorName: "John Doe",
    datePublished: "2026-02-11",
    url: "https://acme.com/blog/my-article"
  });

  return (
    <>
      <Schema data={[org, article]} />
      <main>
        <h1>{article.headline}</h1>
        ...
      </main>
    </>
  );
}
```

## Features

- **Zero client-side JS** - Renders as static JSON-LD
- **Type-safe** - Full TypeScript support
- **Deterministic** - Clean, reviewable diffs
- **Next.js App Router** - Built for Next.js 13+

## Documentation

See [Schema Sentry Docs](https://github.com/arindamdawn/schema-sentry#readme)
npm package: @schemasentry/react
Description: React components for Schema Sentry - works with Next.js Pages Router and other React frameworks.
Latest version: 0.11.0

# @schemasentry/react

React components for Schema Sentry. Works with Next.js Pages Router and other React frameworks.

## Installation

```bash
pnpm add @schemasentry/react @schemasentry/core
```

## Usage

### Next.js Pages Router

In your `_document.js`:

```jsx
import { Html, Head, Main, NextScripts, Script } from "next/document";
import { Schema } from "@schemasentry/react";
import { Organization, WebSite } from "@schemasentry/core";

export default function Document() {
  return (
    <Html lang="en">
      <Head />
      <body>
        {/* Global schema on every page */}
        <Schema 
          data={[
            Organization({ name: "My Company", url: "https://example.com" }),
            WebSite({ name: "My Site", url: "https://example.com" })
          ]} 
        />
        <Main />
        <NextScripts />
      </body>
    </Html>
  );
}
```

In a specific page (e.g., `pages/about.js`):

```jsx
import { Schema } from "@schemasentry/react";
import { Organization, FAQPage } from "@schemasentry/core";

export default function AboutPage() {
  return (
    <div>
      <h1>About Us</h1>
      <Schema 
        data={FAQPage({
          questions: [
            { question: "What is your return policy?", answer: "30 days" },
            { question: "Do you ship internationally?", answer: "Yes, worldwide" }
          ]
        })} 
      />
    </div>
  );
}
```

### Other React Frameworks

Works with any React framework that supports SSR:

```jsx
import { Schema } from "@schemasentry/react";
import { Article } from "@schemasentry/core";

function ArticlePage({ title, content }) {
  return (
    <article>
      <Schema 
        data={Article({
          headline: title,
          author: { name: "John Doe" },
          datePublished: "2024-01-15",
          url: "https://example.com/article"
        })} 
      />
      <h1>{title}</h1>
      <p>{content}</p>
    </article>
  );
}
```

## API

### `<Schema />`

Renders a `<script type="application/ld+json">` tag with the schema data.

```tsx
import { Schema } from "@schemasentry/react";
import { Product } from "@schemasentry/core";

<Schema 
  data={Product({
    name: "Widget",
    description: "A great widget",
    url: "https://example.com/widget"
  })}
  id="product-schema"     // optional: adds id attribute
  nonce="abc123"         // optional: for CSP nonce
/>
```

## TypeScript

Full TypeScript support out of the box. All schema builders from `@schemasentry/core` are re-exported.
npm package: @schemasjs/validator
Description: An opinionated type validator API indpendent from schema validators like Zod, Valibot, etc
Author: Cristobal Contreras Rubio
Latest version: 2.0.2

# @SchemasJS/validator

[![version](https://img.shields.io/npm/v/%40schemasjs%2Fvalidator)](https://img.shields.io/npm/v/%40schemasjs%2Fvalidator) [![Bundle size minified](https://img.shields.io/bundlephobia/min/%40schemasjs/validator/latest)](https://bundlephobia.com/package/@schemasjs/validator) [![build](https://github.com/crisconru/schemasjs/actions/workflows/validator.yml/badge.svg)](https://github.com/crisconru/schemasjs/actions/workflows/validator.yml)

If you love type validators like Zod or Valibot, probably you load a ton of logic
inside schemas. If suddenly you wanted to swap from one type validator to another,
the migration would be a pain.
This package try to minimize this problem.

Validator is an opinionated API to work with your favourites schemas coming from Zod or Valibot. You can use your preferred schemas in and if you need to swap to another
it won't be a problem.

At this moment it is only supported Zod and Valibot.

## How to use Validator

1. In your schemas file, import the proper Validator that you need and create your
validator for each schema.

    ```typescript
    // Zod
    import { z } from 'zod'
    import { ZodValidator } from '@schemasjs/validator'
    import { Uint8Schema as ZodUint8Schema, type Uint8 } from '@schemasjs/zod-numbers'

    const Uint8Schema = new ZodValidator<Uint8>()
    const ZodEmailSchema = z.string().email()
    type Email = z.infer<typeof ZodEmailSchema>
    const EmailSchema = ZodValidator<Email>(ZodEmailSchema)
    // Valibot
    import * as v from 'valibot'
    import { ValibotValidator } from '@schemasjs/validator'
    import { Uint8Schema as ValibotUint8Schema, type Uint8 } from '@schemasjs/valibot-numbers'

    const Uint8Schema = ValibotValidator<Uint8>()
    const ValibotEmailSchema = v.pipe(v.string(), v.email())
    type Email = v.InferInput<typeof ValibotEmailSchema>
    const EmailSchema = ValibotValidator<Email>(ValibotEmailSchema)
    ```

2. Then use it in your code instead your schemas, and that's all.

    ```typescript
    const myEmail = 'foo@bar.com'

    console.log(EmailSchema.is(myEmail) ? 'Valid email' : 'Invalid email') // 'Valid email'

    const parsedEmail = EmailSchema.parse(myEmail) // 'foo@bar.com'

    const parsed = EmailSchema.safeParse(myEmail)

    console.log(parsed.success ? parsed.data : parsed.errors) // 'foo@bar.com'
    ```

## Validator API

```typescript
is: (data: any) => boolean

parse: (data: any) => T

safeParse: (data: any) => SafeParse<T>
```

It is a tiny API based on Zod API + `is` Valibot function API.

`safeParse` return

```typescript
interface SafeParseSuccess<T> {
  success: true
  value: T
}

interface SafeParseFailure {
  success: false
  errors: string[]
}

export type SafeParse<T> = SafeParseSuccess<T> | SafeParseFailure
```
npm package: @schemastore/accelerator
Description: TypeScript definitions for accelerator.
Author: Florian Imdahl
Latest version: 0.0.1

# Installation
> `npm install --save @schemastore/accelerator`

# Summary
This package contains type definitions for accelerator.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/accelerator.

## Additional Details
* Last updated: Thu, Apr 27, 2023, 09:50:32 GMT
* Dependencies: none
npm package: @schemastore/aiproj
Description: TypeScript definitions for aiproj.
Author: Florian Imdahl
Latest version: 0.0.7

# Type definitions for aiproj

## Installation

```
npm i @schemastore/aiproj
yarn add @schemastore/aiproj
```

## Summary

This package contains type definitions for aiproj.

## Usage

```ts
import * as aiproj from '@schemastore/aiproj';
```

## Note

The definitions were auto-generated by [schemastore-updater](https://github.com/ffflorian/schemastore-updater) using [`json-schema-to-typescript`](https://www.npmjs.com/package/json-schema-to-typescript).

## Additional Details

* [Schema source](https://github.com/SchemaStore/schemastore/tree/master/src/schemas/json/aiproj)
* Last updated: Thu, Jan 04, 2024, 19:12:50 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.0
Description: TypeScript definitions for ansible-stable-2.0.
Author: Florian Keller
Latest version: 0.0.3

# Installation
> `npm install --save @schemastore/ansible-stable-2.0`

# Summary
This package contains type definitions for ansible-stable-2.0.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.0.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 09:32:57 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.1
Description: TypeScript definitions for ansible-stable-2.1.
Author: Florian Keller
Latest version: 0.0.3

# Installation
> `npm install --save @schemastore/ansible-stable-2.1`

# Summary
This package contains type definitions for ansible-stable-2.1.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.1.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 09:34:27 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.2
Description: TypeScript definitions for ansible-stable-2.2.
Author: Florian Keller
Latest version: 0.0.3

# Installation
> `npm install --save @schemastore/ansible-stable-2.2`

# Summary
This package contains type definitions for ansible-stable-2.2.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.2.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 09:37:12 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.3
Description: TypeScript definitions for ansible-stable-2.3.
Author: Florian Keller
Latest version: 0.0.3

# Installation
> `npm install --save @schemastore/ansible-stable-2.3`

# Summary
This package contains type definitions for ansible-stable-2.3.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.3.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 09:43:15 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.4
Description: TypeScript definitions for ansible-stable-2.4.
Author: Florian Keller
Latest version: 0.0.3

# Installation
> `npm install --save @schemastore/ansible-stable-2.4`

# Summary
This package contains type definitions for ansible-stable-2.4.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.4.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 09:55:08 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.5
Description: TypeScript definitions for ansible-stable-2.5.
Author: Florian Keller
Latest version: 0.0.3

# Installation
> `npm install --save @schemastore/ansible-stable-2.5`

# Summary
This package contains type definitions for ansible-stable-2.5.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.5.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 10:06:57 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.6
Description: TypeScript definitions for ansible-stable-2.6.
Author: Florian Keller
Latest version: 0.0.4

# Installation
> `npm install --save @schemastore/ansible-stable-2.6`

# Summary
This package contains type definitions for ansible-stable-2.6.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.6.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 10:30:51 GMT
* Dependencies: none
npm package: @schemastore/ansible-stable-2.7
Description: TypeScript definitions for ansible-stable-2.7.
Author: Florian Keller
Latest version: 0.0.4

# Installation
> `npm install --save @schemastore/ansible-stable-2.7`

# Summary
This package contains type definitions for ansible-stable-2.7.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/ansible-stable-2.7.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 11:00:02 GMT
* Dependencies: none
npm package: @schemastore/base-04
Description: TypeScript definitions for base-04.
Author: Florian Imdahl
Latest version: 0.0.2

# Installation
> `npm install --save @schemastore/base-04`

# Summary
This package contains type definitions for base-04.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/base-04.

## Additional Details
* Last updated: Thu, Apr 27, 2023, 09:50:34 GMT
* Dependencies: none
npm package: @schemastore/circleciconfig
Description: TypeScript definitions for circleciconfig.
Author: Florian Keller
Latest version: 0.0.7

# Installation
> `npm install --save @schemastore/circleciconfig`

# Summary
This package contains type definitions for circleciconfig.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/circleciconfig.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 11:00:04 GMT
* Dependencies: none
npm package: @schemastore/cirrus
Description: TypeScript definitions for cirrus.
Author: Florian Imdahl
Latest version: 0.0.8

# Type definitions for cirrus

## Installation

```
npm i @schemastore/cirrus
yarn add @schemastore/cirrus
```

## Summary

This package contains type definitions for cirrus.

## Usage

```ts
import * as cirrus from '@schemastore/cirrus';
```

## Note

The definitions were auto-generated by [schemastore-updater](https://github.com/ffflorian/schemastore-updater) using [`json-schema-to-typescript`](https://www.npmjs.com/package/json-schema-to-typescript).

## Additional Details

* [Schema source](https://github.com/SchemaStore/schemastore/tree/master/src/schemas/json/cirrus)
* Last updated: Sat, Jul 19, 2025, 17:01:19 GMT
* Dependencies: none
npm package: @schemastore/clasp
Description: TypeScript definitions for clasp.
Author: Florian Imdahl
Latest version: 1.0.10

# Type definitions for clasp

## Installation

```
npm i @schemastore/clasp
yarn add @schemastore/clasp
```

## Summary

This package contains type definitions for clasp.

## Usage

```ts
import * as clasp from '@schemastore/clasp';
```

## Note

The definitions were auto-generated by [schemastore-updater](https://github.com/ffflorian/schemastore-updater) using [`json-schema-to-typescript`](https://www.npmjs.com/package/json-schema-to-typescript).

## Additional Details

* [Schema source](https://github.com/SchemaStore/schemastore/tree/master/src/schemas/json/clasp)
* Last updated: Sat, Jul 19, 2025, 17:01:19 GMT
* Dependencies: none
npm package: @schemastore/comet
Description: TypeScript definitions for comet.
Author: Florian Imdahl
Latest version: 0.0.7

# Type definitions for comet

## Installation

```
npm i @schemastore/comet
yarn add @schemastore/comet
```

## Summary

This package contains type definitions for comet.

## Usage

```ts
import * as comet from '@schemastore/comet';
```

## Note

The definitions were auto-generated by [schemastore-updater](https://github.com/ffflorian/schemastore-updater) using [`json-schema-to-typescript`](https://www.npmjs.com/package/json-schema-to-typescript).

## Additional Details

* [Schema source](https://github.com/SchemaStore/schemastore/tree/master/src/schemas/json/comet)
* Last updated: Sat, Jul 19, 2025, 17:01:19 GMT
* Dependencies: none
npm package: @schemastore/composer
Description: TypeScript definitions for composer.
Author: Florian Keller
Latest version: 0.0.7

# Installation
> `npm install --save @schemastore/composer`

# Summary
This package contains type definitions for composer.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/composer.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 11:00:05 GMT
* Dependencies: none
npm package: @schemastore/config
Description: TypeScript definitions for config.
Author: Florian Imdahl
Latest version: 0.0.5

# Installation
> `npm install --save @schemastore/config`

# Summary
This package contains type definitions for config.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/config.

## Additional Details
* Last updated: Fri, Feb 24, 2023, 11:23:32 GMT
* Dependencies: none
npm package: @schemastore/contribute
Description: TypeScript definitions for contribute.
Author: Florian Keller
Latest version: 0.0.5

# Installation
> `npm install --save @schemastore/contribute`

# Summary
This package contains type definitions for contribute.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/contribute.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 11:00:05 GMT
* Dependencies: none
npm package: @schemastore/csr
Description: TypeScript definitions for csr.
Author: Florian Imdahl
Latest version: 0.0.6

# Type definitions for csr

## Installation

```
npm i @schemastore/csr
yarn add @schemastore/csr
```

## Summary

This package contains type definitions for csr.

## Usage

```ts
import * as csr from '@schemastore/csr';
```

## Note

The definitions were auto-generated by [schemastore-updater](https://github.com/ffflorian/schemastore-updater) using [`json-schema-to-typescript`](https://www.npmjs.com/package/json-schema-to-typescript).

## Additional Details

* [Schema source](https://github.com/SchemaStore/schemastore/tree/master/src/schemas/json/csr)
* Last updated: Sat, Jul 19, 2025, 17:01:20 GMT
* Dependencies: none
npm package: @schemastore/fantomas
Description: TypeScript definitions for fantomas.
Author: Florian Keller
Latest version: 0.0.2

# Installation
> `npm install --save @schemastore/fantomas`

# Summary
This package contains type definitions for fantomas.

## Details
Files were exported from https://github.com/ffflorian/schemastore-updater/tree/main/schemas/fantomas.

## Additional Details
* Last updated: Sat, Jul 04, 2020, 11:00:18 GMT
* Dependencies: none