{"id":19342723,"url":"https://github.com/benbender/next-datocms-ts","last_synced_at":"2025-10-09T17:37:11.754Z","repository":{"id":68351638,"uuid":"385539471","full_name":"benbender/next-datocms-ts","owner":"benbender","description":"NextJS with DatoCMS, TailwindCSS, GraphQL-Codegen, Typescript and perfect typing","archived":false,"fork":false,"pushed_at":"2021-07-13T10:54:35.000Z","size":580,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T17:37:09.330Z","etag":null,"topics":["datocms","graphql","graphql-codegen","nextjs","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"https://next-datocms-ts.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benbender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-13T08:54:01.000Z","updated_at":"2024-02-19T22:39:49.000Z","dependencies_parsed_at":"2023-07-28T07:45:28.792Z","dependency_job_id":null,"html_url":"https://github.com/benbender/next-datocms-ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/benbender/next-datocms-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbender%2Fnext-datocms-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbender%2Fnext-datocms-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbender%2Fnext-datocms-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbender%2Fnext-datocms-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benbender","download_url":"https://codeload.github.com/benbender/next-datocms-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benbender%2Fnext-datocms-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001869,"owners_count":26083197,"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-10-09T02:00:07.460Z","response_time":59,"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":["datocms","graphql","graphql-codegen","nextjs","tailwindcss","typescript"],"created_at":"2024-11-10T03:36:01.201Z","updated_at":"2025-10-09T17:37:11.735Z","avatar_url":"https://github.com/benbender.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Blog example using Next.js and DatoCMS with Typescript and full typings\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\nAdditionally it has GraphQL-Codegen, Typescript and perfect typings and some other goodies!\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://next-datocms-ts.vercel.app/](https://next-datocms-ts.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=benbender/next-datocms-ts)\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fbenbender%2Fnext-datocms-ts\u0026env=NEXT_CMS_DATOCMS_API_TOKEN\u0026envDescription=NEXT_CMS_DATOCMS_API_TOKEN\u0026envLink=https%3A%2F%2Fwww.datocms.com%2Fdocs%2Fcontent-management-api%2Fsetting-the-environment)\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.example` file in this directory to `.env` (which will be ignored by Git):\n\n```bash\ncp .env.example .env\n```\n\nThen set each variable on `.env`:\n\n- `NEXT_CMS_DATOCMS_API_TOKEN` should be the API token you just copied.\n- `NEXT_CMS_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` file should look like this:\n\n```bash\nNEXT_CMS_DATOCMS_API_TOKEN=...\nNEXT_CMS_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/preview?secret=\u003csecret\u003e\n```\n\n- `\u003csecret\u003e` should be the string you entered for `NEXT_CMS_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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbender%2Fnext-datocms-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenbender%2Fnext-datocms-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenbender%2Fnext-datocms-ts/lists"}