@answerfox/schemas
v0.2.1
Published
Type-safe JSON-LD generators for the Answerfox SEO toolkit (Organization, FAQPage, Article, ...).
Downloads
449
Readme
@answerfox/schemas
Type-safe JSON-LD generators for the Answerfox SEO toolkit. Each generator returns a fully-typed WithContext<T> object validated at the type level by schema-dts.
v0.1.0. All eight generators ship today:
organization,webSite,article,breadcrumb,faqPage,howTo,product, andsoftwareApplication.
Install
pnpm add @answerfox/schemasUsage
import { organization, webSite } from '@answerfox/schemas';
const org = organization({
name: 'Acme',
url: 'https://acme.com',
logo: 'https://acme.com/logo.png',
sameAs: ['https://twitter.com/acme', 'https://github.com/acme'],
});
const site = webSite({
name: 'Acme',
url: 'https://acme.com',
searchUrlTemplate: 'https://acme.com/search?q={search_term_string}',
});
// Inject as JSON-LD in your Next.js layout:
// <script type="application/ld+json">{JSON.stringify(org)}</script>All URL inputs are validated as absolute http(s) URLs at runtime — invalid input throws InvalidUrlError from @answerfox/core.
License
MIT © 2026 Anuj Ojha
