Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vogelino/notion-api-zod-schema
Zod schemas for the Notion API (unofficial)
https://github.com/vogelino/notion-api-zod-schema
notion notion-api schema unofficial validation zod
Last synced: about 1 month ago
JSON representation
Zod schemas for the Notion API (unofficial)
- Host: GitHub
- URL: https://github.com/vogelino/notion-api-zod-schema
- Owner: vogelino
- License: mit
- Created: 2023-08-12T20:13:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-03T22:09:37.000Z (about 1 year ago)
- Last Synced: 2024-06-11T18:23:56.309Z (7 months ago)
- Topics: notion, notion-api, schema, unofficial, validation, zod
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/notion-api-zod-schema
- Size: 44.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zod Schemas for the Notion-API Data-Structures
Zod schemas for the Notion API data sctructure. This is an unofficial package made for personal use only.
If you have any suggestions on how to improve this make sure to add an issue or even better, a pull request.Enjoy!
## Installation
```sh
npm install notion-api-zod-schemas
```## Usage
```ts
import { z } from 'zod'
import {
NotionMultiSelectSchema,
NotionPageSchema,
NotionTimeSchema,
NotionTitleSchema,
NotionUrlSchema,
} from 'notion-api-zod-schema'const CustomSchema = NotionPageSchema.extend({
properties: z.object({
Created: NotionTimeSchema,
URL: NotionUrlSchema,
Tags: NotionMultiSelectSchema,
Name: NotionTitleSchema,
}),
})
type CustomType = z.inferCustomSchema.parse({
... // Your data here
})
```