@glyphhq/contracts
v0.1.0
Published
Machine-readable contract for the Glyph ingest API: JSON Schema, conformance fixtures, and the cross-SDK parity spec.
Readme
@glyphhq/contracts
Machine-readable contract for the Glyph ingest API. This package is the source of truth that the Glyph SDKs and the public docs are built against.
Integrating Glyph into an application? You want an SDK, not this package:
@glyphhq/browser— browser@glyphhq/node— Node.jsglyphhq— Python
Use this package directly when you are validating ingest payloads yourself, generating types, or building a Glyph client for a platform without an official SDK.
Contents
ingest-v1.schema.json— JSON Schema for theingest-v1wire format accepted byPOST https://in.glyphhq.io/api/v1/ingest.fixtures/messages.json— conformance vectors: input → exact wire payload pairs that every official SDK reproduces byte-for-byte in its test suite.PARITY.md— the behavioral spec shared by every SDK: timestamps, identifiers, batching, retries, and error handling.
Usage
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const schema = require("@glyphhq/contracts/ingest-v1.schema.json");Validate candidate payloads with any JSON Schema validator (for example
Ajv). If you are building your own client, reproduce the
fixtures/messages.json vectors in your test suite and follow PARITY.md —
that is exactly what the official SDKs do.
Versioning
The wire format is itself versioned (ingest-v1): breaking changes to the wire
shape ship as a new schema, not as edits to this one. Package releases add
fields, fixtures, or clarifications within the current wire version.
