{"id":19008901,"url":"https://github.com/qqpann/notcms","last_synced_at":"2026-01-18T02:54:40.535Z","repository":{"id":261634609,"uuid":"815493076","full_name":"qqpann/notcms","owner":"qqpann","description":"NotCMS makes it easy to create a headless CMS, from Notion","archived":false,"fork":false,"pushed_at":"2025-04-02T22:48:35.000Z","size":11892,"stargazers_count":10,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T18:02:32.601Z","etag":null,"topics":["api","blog","cms","content","content-management-system","headless-cms","javascript","nodejs","notcms","notion","notion-api","sdk","typescript"],"latest_commit_sha":null,"homepage":"https://notcms.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qqpann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-15T10:20:27.000Z","updated_at":"2025-03-30T11:35:29.000Z","dependencies_parsed_at":"2024-11-23T16:24:58.113Z","dependency_job_id":"bd47ac6b-824a-43ef-b06b-9dc72d07a546","html_url":"https://github.com/qqpann/notcms","commit_stats":null,"previous_names":["qqpann/notcms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqpann%2Fnotcms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqpann%2Fnotcms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqpann%2Fnotcms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qqpann%2Fnotcms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qqpann","download_url":"https://codeload.github.com/qqpann/notcms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249303558,"owners_count":21247696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","blog","cms","content","content-management-system","headless-cms","javascript","nodejs","notcms","notion","notion-api","sdk","typescript"],"created_at":"2024-11-08T19:05:49.053Z","updated_at":"2026-01-18T02:54:40.528Z","avatar_url":"https://github.com/qqpann.png","language":"TypeScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://notcms.com\"\u003e\n    \u003cpicture\u003e\n      \u003cimg alt=\"NotCMS logo\" src=\"/docs/assets/notcms-icon.png\" height=\"128\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n  \u003ch1\u003eNotCMS\u003c/h1\u003e\n\n  \u003ca href=\"https://notcms.com\"\u003e\n    Website\n  \u003c/a\u003e · \n  \u003ca href=\"https://dash.notcms.com\"\u003e\n    Dashboard\n  \u003c/a\u003e · \n  \u003ca href=\"https://notcms.com/templates\"\u003e\n    Templates\n  \u003c/a\u003e · \n  \u003ca href=\"https://notcms.com/blog\"\u003e\n    Blog\n  \u003c/a\u003e\n\nNotCMS makes it easy to create a CMS, from Notion. It provides a type-safe TypeScript SDK to interact with Notion databases as your content backend.\n\n[![npm package][npm-img]][npm-url]\n[![Downloads][downloads-img]][downloads-url]\n[![Issues][issues-img]][issues-url]\n[![DeepWiki][deepwiki-img]][deepwiki-url]\n\n\u003c/div\u003e\n\n## Key Features\n\n- 🛡️ **Type Safety**: Fully typed queries and responses using TypeScript\n- 🎯 **Simple API**: Clean and intuitive API for fetching content\n- 📝 **Notion as Backend**: Use Notion's user-friendly editor for content creation\n- 🔄 **Framework Agnostic**: Works with any JavaScript framework (Next.js, React, Vue, etc.)\n- 🛠️ **CLI Tools**: Includes notcms-kit for easy project setup and schema management\n\n## Getting Started\n\n### Installation\n\n```bash\nnpm install notcms\n```\n\n### Usage\n\n#### 0. Set Up Environment Variables\n\nCreate a `.env` file in your project root:\n\n```env\nNOTCMS_SECRET_KEY=your_secret_key\nNOTCMS_WORKSPACE_ID=your_workspace_id\n```\n\nYou can get these values from the NotCMS Dashboard.\n\n#### 1. Initialize a Project\n\nNotCMS Kit provides command-line tools to streamline your workflow. You can use it directly with npx:\n\n```bash\nnpx notcms-kit init\n```\n\nThis will create a `notcms.config.json` file in your project root.\n\n#### 2. Define Your Schema\n\nThe easiest way to define your schema is to use NotCMS Kit:\n\n```bash\nnpx notcms-kit pull\n```\n\nThis will automatically fetch your database schema from Notion and generate a TypeScript schema file.\n\nFor reference, the generated schema will look something like this:\n\n```ts\n// src/notcms/schema.ts\nimport { Client, Schema } from \"notcms\";\n\nexport const schema = {\n  blog: {\n    id: \"your_notion_database_id\",\n    properties: {\n      title: \"title\",\n      description: \"rich_text\",\n      published: \"checkbox\",\n      thumbnails: \"files\",\n      // Run notcms-kit pull again when properties are updated\n    },\n  },\n} satisfies Schema;\n\nexport const nc = new Client({ schema });\n```\n\n#### 3. Query Your Content\n\n```ts\nimport { nc } from \"./notcms/schema\";\n\n// List all blog posts\nconst [pages] = await nc.query.blog.list();\n\n// Get a specific blog post\nconst [page] = await nc.query.blog.get(\"page_id\");\n\n// Handle errors\nconst [data, error] = await nc.query.blog.list();\nif (error) {\n  console.error(\"Failed to fetch blog posts:\", error);\n}\n```\n\n## Examples and Templates\n\nCheck out these examples to get started quickly:\n\n- 📚 [Next.js Simple Blog Template](https://github.com/qqpann/notcms/tree/main/examples/nextjs-simple-blog-template)\n- 🎨 [More templates available on our website](https://notcms.com/templates)\n\n## Troubleshooting\n\n### Authentication Errors\n\nIf you see errors like \"secretKey is required\" or \"workspaceId is required\", make sure:\n\n1. Your environment variables are correctly set\n2. You're using the correct variable names (`NOTCMS_SECRET_KEY` and `NOTCMS_WORKSPACE_ID`)\n3. Your environment variables are being loaded properly\n\n### Schema Errors\n\nIf you encounter schema-related errors:\n\n1. Make sure your Notion database IDs are correct\n2. Verify that the property types match what's in your Notion database\n3. Try running `npx notcms-kit pull` to regenerate your schema\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n**Note**: This project uses [Changesets](https://github.com/changesets/changesets) for version management. When making changes that should be released, please run `pnpm changeset` to create a changeset describing your changes.\n\n## License\n\nThis project is organized as a monorepo with multiple packages:\n\n- `packages/notcms`: [MIT License](packages/notcms/LICENSE)\n- `packages/notcms-kit`: [MIT License](packages/notcms-kit/LICENSE)\n- `examples/`: [MIT License](examples/LICENSE)\n\nSee individual directories for specific license details.\n\n\u003c!-- --\u003e\n\n[build-img]: https://github.com/qqpann/notcms/actions/workflows/release.yml/badge.svg\n[build-url]: https://github.com/qqpann/notcms/actions/workflows/release.yml\n[downloads-img]: https://img.shields.io/npm/dt/notcms\n[downloads-url]: https://www.npmtrends.com/notcms\n[npm-img]: https://img.shields.io/npm/v/notcms\n[npm-url]: https://www.npmjs.com/package/notcms\n[issues-img]: https://img.shields.io/github/issues/qqpann/notcms\n[issues-url]: https://github.com/qqpann/notcms/issues\n[codecov-img]: https://codecov.io/gh/qqpann/notcms/branch/main/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/qqpann/notcms\n[semantic-release-img]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-release-url]: https://github.com/semantic-release/semantic-release\n[commitizen-img]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg\n[commitizen-url]: http://commitizen.github.io/cz-cli/\n[deepwiki-img]: https://img.shields.io/badge/deepwiki-qqpann%2Fnotcms-blue\n[deepwiki-url]: https://deepwiki.com/qqpann/notcms\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqqpann%2Fnotcms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqqpann%2Fnotcms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqqpann%2Fnotcms/lists"}