{"id":13515359,"url":"https://github.com/datocms/nextjs-demo","last_synced_at":"2025-09-23T06:46:07.493Z","repository":{"id":41815857,"uuid":"246314252","full_name":"datocms/nextjs-demo","owner":"datocms","description":"Next.js powered blog with DatoCMS integration","archived":false,"fork":false,"pushed_at":"2025-02-06T08:12:02.000Z","size":17925,"stargazers_count":145,"open_issues_count":5,"forks_count":51,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-24T10:06:26.058Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"nextjs-demo-bay.vercel.app","language":"JavaScript","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/datocms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-03-10T13:53:22.000Z","updated_at":"2025-05-23T00:06:24.000Z","dependencies_parsed_at":"2023-12-20T20:37:16.668Z","dependency_job_id":"37bec7ca-118b-4a91-b4cc-4a343690d946","html_url":"https://github.com/datocms/nextjs-demo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/datocms/nextjs-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datocms%2Fnextjs-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datocms%2Fnextjs-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datocms%2Fnextjs-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datocms%2Fnextjs-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datocms","download_url":"https://codeload.github.com/datocms/nextjs-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datocms%2Fnextjs-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276531302,"owners_count":25658697,"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","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T05:01:10.124Z","updated_at":"2025-09-23T06:46:07.445Z","avatar_url":"https://github.com/datocms.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003c!--datocms-autoinclude-header start--\u003e\n\n\u003ca href=\"https://www.datocms.com/\"\u003e\u003cimg src=\"https://www.datocms.com/images/full_logo.svg\" height=\"60\"\u003e\u003c/a\u003e\n\n👉 [Visit the DatoCMS homepage](https://www.datocms.com) or see [What is DatoCMS?](#what-is-datocms)\n\n---\n\n\u003c!--datocms-autoinclude-header end--\u003e\n\n# A Blog example using Next.js and DatoCMS\n\nThis example showcases a Next.js Blog using [DatoCMS](https://www.datocms.com/) as the data source. It fully supports [Preview Mode](https://www.datocms.com/docs/next-js/setting-up-next-js-preview-mode) with [DatoCMS real-time updates](https://www.datocms.com/docs/next-js/real-time-updates).\n\nThe purpose of this repo is to have a quick start reference that can be set up with the \"one-click\" button below.\n\n## Demo\n\nHave a look at the end result live:\n\n### [https://nextjs-demo-bay.vercel.app/](https://nextjs-demo-bay.vercel.app/)\n\n## How to use\n\n### Quick start\n\n1. [Create an account on DatoCMS](https://datocms.com).\n\n2. Make sure that you have set up the [Github integration on Vercel](https://vercel.com/docs/git/vercel-for-github).\n\n3. Let DatoCMS set everything up for you clicking this button:\n\n[![Deploy with DatoCMS](https://dashboard.datocms.com/deploy/button.svg)](https://dashboard.datocms.com/deploy?repo=datocms/nextjs-demo)\n\n### Local setup\n\nOnce the setup of the project and repo is done, clone the repo locally.\n\n#### Set up environment variables\n\nIn your DatoCMS' project, go to the **Settings** menu at the top and click **API tokens**.\n\nThen click **Read-only API token** and copy the token.\n\nNext, copy the `.env.local.example` file in this directory to `.env.local` (which will be ignored by Git):\n\n```bash\ncp .env.local.example .env.local\n```\n\nThen set each variable inside `.env.local`:\n\n- `NEXT_DATOCMS_API_TOKEN` should be the API token you just copied.\n- `NEXT_DATOCMS_PREVIEW_SECRET` can be any random string (but avoid spaces), like `MY_SECRET` - this is used for the Preview Mode](https://www.datocms.com/docs/next-js/setting-up-next-js-preview-mode).\n\nYour `.env.local` file should look like this:\n\n```bash\nNEXT_DATOCMS_API_TOKEN=...\nNEXT_DATOCMS_PREVIEW_SECRET=...\n```\n\n#### Run your project locally\n\n```bash\nnpm install\nnpm run dev\n```\n\nYour blog should be up and running on [http://localhost:3000](http://localhost:3000)!\n\n#### Try preview mode\n\nOn DatoCMS, go to one of the posts you've created and:\n\n- **Update the title**. For example, you can add `[Draft]` in front of the title.\n- Click **Save**, but **DO NOT** click **Publish**. By doing this, the post will be in the draft state.\n\n(If it doesn't become draft, you need to go to the model settings for `Post`, go to **Additional Settings**, and turn on **Enable draft/published system**.)\n\nNow, if you go to the post page on localhost, you won't see the updated title. However, if you use the **Preview Mode**, you'll be able to see the change ([Documentation](https://www.datocms.com/docs/next-js/setting-up-next-js-preview-mode)).\n\nTo enable the Preview Mode, go to this URL:\n\n```\nhttp://localhost:3000/api/draft?secret=\u003csecret\u003e\n```\n\n- `\u003csecret\u003e` should be the string you entered for `NEXT_DATOCMS_PREVIEW_SECRET`.\n- `\u003cslug\u003e` should be the post's `slug` attribute (you can check on DatoCMS).\n\nYou should now be able to see the updated title. To exit the preview mode, you can click **Click here to exit preview mode** at the top.\n\n\u003c!--datocms-autoinclude-footer start--\u003e\n\n---\n\n# What is DatoCMS?\n\n\u003ca href=\"https://www.datocms.com/\"\u003e\u003cimg src=\"https://www.datocms.com/images/full_logo.svg\" height=\"60\" alt=\"DatoCMS - The Headless CMS for the Modern Web\"\u003e\u003c/a\u003e\n\n[DatoCMS](https://www.datocms.com/) is the REST \u0026 GraphQL Headless CMS for the modern web.\n\nTrusted by over 25,000 enterprise businesses, agencies, and individuals across the world, DatoCMS users create online content at scale from a central hub and distribute it via API. We ❤️ our [developers](https://www.datocms.com/team/best-cms-for-developers), [content editors](https://www.datocms.com/team/content-creators) and [marketers](https://www.datocms.com/team/cms-digital-marketing)!\n\n**Why DatoCMS?**\n\n- **API-First Architecture**: Built for both REST and GraphQL, enabling flexible content delivery\n- **Just Enough Features**: We believe in keeping things simple, and giving you [the right feature-set tools](https://www.datocms.com/features) to get the job done\n- **Developer Experience**: First-class TypeScript support with powerful developer tools\n\n**Getting Started:**\n\n- ⚡️ [Create Free Account](https://dashboard.datocms.com/signup) - Get started with DatoCMS in minutes\n- 🔖 [Documentation](https://www.datocms.com/docs) - Comprehensive guides and API references\n- ⚙️ [Community Support](https://community.datocms.com/) - Get help from our team and community\n- 🆕 [Changelog](https://www.datocms.com/product-updates) - Latest features and improvements\n\n**Official Libraries:**\n\n- [**Content Delivery Client**](https://github.com/datocms/cda-client) - TypeScript GraphQL client for content fetching\n- [**REST API Clients**](https://github.com/datocms/js-rest-api-clients) - Node.js/Browser clients for content management\n- [**CLI Tools**](https://github.com/datocms/cli) - Command-line utilities for schema migrations (includes [Contentful](https://github.com/datocms/cli/tree/main/packages/cli-plugin-contentful) and [WordPress](https://github.com/datocms/cli/tree/main/packages/cli-plugin-wordpress) importers)\n\n**Official Framework Integrations**\n\nHelpers to manage SEO, images, video and Structured Text coming from your DatoCMS projects:\n\n- [**React Components**](https://github.com/datocms/react-datocms)\n- [**Vue Components**](https://github.com/datocms/vue-datocms)\n- [**Svelte Components**](https://github.com/datocms/datocms-svelte)\n- [**Astro Components**](https://github.com/datocms/astro-datocms)\n\n**Additional Resources:**\n\n- [**Plugin Examples**](https://github.com/datocms/plugins) - Example plugins we've made that extend the editor/admin dashboard\n- [**Starter Projects**](https://www.datocms.com/marketplace/starters) - Example website implementations for popular frameworks\n- [**All Public Repositories**](https://github.com/orgs/datocms/repositories?q=\u0026type=public\u0026language=\u0026sort=stargazers)\n\n\u003c!--datocms-autoinclude-footer end--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatocms%2Fnextjs-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatocms%2Fnextjs-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatocms%2Fnextjs-demo/lists"}