{"id":13407855,"url":"https://github.com/sanity-io/netlify-form-sanity","last_synced_at":"2025-10-12T11:54:53.291Z","repository":{"id":45139884,"uuid":"167801408","full_name":"sanity-io/netlify-form-sanity","owner":"sanity-io","description":"How to use Netlify Forms and Functions to submit data to Sanity.io","archived":false,"fork":false,"pushed_at":"2024-11-02T14:43:57.000Z","size":236,"stargazers_count":48,"open_issues_count":10,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-02T06:56:48.772Z","etag":null,"topics":["api","headless-cms","netlify","netlify-forms","netlify-functions","sanity","sanity-io","serverless"],"latest_commit_sha":null,"homepage":"https://www.sanity.io","language":"HTML","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/sanity-io.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}},"created_at":"2019-01-27T11:32:47.000Z","updated_at":"2025-07-28T09:35:08.000Z","dependencies_parsed_at":"2023-01-20T05:34:00.270Z","dependency_job_id":null,"html_url":"https://github.com/sanity-io/netlify-form-sanity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sanity-io/netlify-form-sanity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fnetlify-form-sanity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fnetlify-form-sanity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fnetlify-form-sanity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fnetlify-form-sanity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanity-io","download_url":"https://codeload.github.com/sanity-io/netlify-form-sanity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fnetlify-form-sanity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011192,"owners_count":26084900,"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-12T02:00:06.719Z","response_time":53,"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":["api","headless-cms","netlify","netlify-forms","netlify-functions","sanity","sanity-io","serverless"],"created_at":"2024-07-30T20:00:49.035Z","updated_at":"2025-10-12T11:54:53.235Z","avatar_url":"https://github.com/sanity-io.png","language":"HTML","funding_links":[],"categories":["Sample projects"],"sub_categories":["How-to's"],"readme":"# How to use Netlify Forms and Functions to submit data to Sanity.io\n\nThis is a simple example of how you can use Forms and Functions in [Netlify](https://netlify.com) to submit data to your Sanity.io project.\n\n![Demonstration of Netlify form via Functions to Sanity Studio](https://cdn.sanity.io/images/3do82whm/production/1728e9c2e1a25edbbb914e53edff8ded40ed2567-1642x1056.gif)\n\n## How to use\n\n1. Fork or clone this repo\n2. Run `yarn` or `npm install`\n3. Change the `projectId` and the `dataset` configuration in `/lambda/submission-created.js` to your Sanity.io project`s\n4. Commit and push the changes to your GitHub repo\n5. Connect Netlify to that repo, and add a environment variable in Netlify called `SANITY_TOKEN`\n6. Go to your Settings -\u003e API in your project at [manage.sanity.io](https://manage.sanity.io), and add a token with `write` rights.\n7. Paste this token as the value for `SANITY_TOKEN` (be careful with where you store this token!)\n8. Submissions will be stored with `_id` on [a path](https://www.sanity.io/docs/ids): `\"submission.\u003cuuid\u003e\"`, and will not be available through the public API without a token with `read` rights.\n9. If you want to view the submissions in the Studio, you can add the following schema to your project:\n\n```js\n/*\n * Doesn't cover all the data fields.\n * Remove or set readOnly to `false` if you want to be able\n * to edit the responses in the Studio\n */\n\nexport default {\n  name: 'submission.form',\n  type: 'document',\n  title: 'Form submission',\n  readOnly: true,\n  fields: [\n    {\n      name: 'title',\n      type: 'string',\n      title: 'Title'\n    },\n    {\n      name: 'number',\n      type: 'number',\n      title: 'Number'\n    },\n    {\n      name: 'created_at',\n      type: 'datetime',\n      title: 'Created at'\n    },\n    {\n      name: 'data',\n      type: 'object',\n      title: 'Data',\n      fields: [\n        {\n          name: 'email',\n          type: 'email',\n          title: 'Email'\n        },\n        {\n          name: 'name',\n          type: 'string',\n          title: 'Name'\n        },\n        {\n          name: 'message',\n          type: 'text',\n          title: 'Message'\n        },\n        {\n          name: 'role',\n          type: 'array',\n          title: 'Role',\n          of: [{ type: 'string' }]\n        }\n      ]\n    }\n  ]\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanity-io%2Fnetlify-form-sanity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanity-io%2Fnetlify-form-sanity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanity-io%2Fnetlify-form-sanity/lists"}