@stremio-addon/zod
v0.2.0
Published
Community Stremio Addon SDK validation using zod
Maintainers
Readme
@stremio-addon/zod
This package is part of Stremio-Community/stremio-addon-sdk.
Validation package for the Community Stremio Addon SDK using zod.
Features
- ✅ Runtime validation - Validates addon manifest and responses using Zod schemas
- 🎯 Type-safe - Full TypeScript support with inferred types from Zod schemas
- 🚀 Modern - Popular validation library
Installation
pnpm add @stremio-addon/zod zodUsage
import { AddonBuilder } from "@stremio-addon/zod";
// The AddonBuilder from this package automatically validates
// your manifest against the Zod schema
const builder = new AddonBuilder({
id: "com.example.myaddon",
version: "1.0.0",
name: "My Addon",
description: "My cool Stremio addon",
resources: ["stream"],
types: ["movie", "series"],
catalogs: [],
});
// Define handlers as usual
builder.defineStreamHandler(async ({ type, id }) => {
return {
streams: [
{
url: "https://example.com/stream.mp4",
title: "Example Stream",
},
],
};
});
const addonInterface = builder.getInterface();API
This package exports:
AddonBuilder- Extended builder that validates manifests usingzodmanifestSchema- Zod schema for addon manifests
Related Packages
@stremio-addon/sdk- Core SDK package@stremio-addon/linter- Alternative validation usingstremio-addon-linter
License
MIT
