{"id":13432897,"url":"https://github.com/francisconeves97/react-google-forms-hooks","last_synced_at":"2026-01-16T18:03:50.039Z","repository":{"id":40398994,"uuid":"372253018","full_name":"francisconeves97/react-google-forms-hooks","owner":"francisconeves97","description":"Build a UI for your Google Forms using React.","archived":false,"fork":false,"pushed_at":"2024-05-16T03:38:20.000Z","size":2309,"stargazers_count":36,"open_issues_count":12,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-22T00:15:30.960Z","etag":null,"topics":["googleforms","hooks","react"],"latest_commit_sha":null,"homepage":"https://francisconeves97.github.io/react-google-forms-hooks/","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/francisconeves97.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":"2021-05-30T15:41:24.000Z","updated_at":"2025-08-12T07:16:49.000Z","dependencies_parsed_at":"2024-06-18T21:32:07.771Z","dependency_job_id":"bbcfda2b-2046-4dfa-a4ed-ffc120d7d1be","html_url":"https://github.com/francisconeves97/react-google-forms-hooks","commit_stats":{"total_commits":93,"total_committers":6,"mean_commits":15.5,"dds":"0.21505376344086025","last_synced_commit":"100b8556a34c0ed7bc190b62fa59bd266f9c7de1"},"previous_names":["francisconeves97/react-google-forms"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/francisconeves97/react-google-forms-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisconeves97%2Freact-google-forms-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisconeves97%2Freact-google-forms-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisconeves97%2Freact-google-forms-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisconeves97%2Freact-google-forms-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/francisconeves97","download_url":"https://codeload.github.com/francisconeves97/react-google-forms-hooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/francisconeves97%2Freact-google-forms-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["googleforms","hooks","react"],"created_at":"2024-07-31T02:01:18.242Z","updated_at":"2026-01-16T18:03:50.023Z","avatar_url":"https://github.com/francisconeves97.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# React Google Forms Hooks\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-6-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n## Description\n\nThis library allows you to build a UI for your Google Forms using React. It provides a set of tools and hooks to give you a good experience while developing. It's build as a wrapper on top of [react-hook-forms](https://github.com/react-hook-form/react-hook-form).\n\n## Live demo\n\nYou can check an example form built using this library here: https://francisconeves97.github.io/react-google-forms-hooks/\n\nYou can also play around on the example on this [CodeSandbox](https://codesandbox.io/s/pedantic-gould-w0ib1?file=/src/App.js).\n\n## Install\n\n```bash\nnpm install --save react-google-forms-hooks\n```\n\n## Usage\n\nUse the `googleFormsToJson` script to convert your google form into a json and save it into a file.\n\n```javascript\nimport { googleFormsToJson } from 'react-google-forms-hooks'\n\n// can use both full and shortened form url\nconst result = await googleFormsToJson(\n  'https://docs.google.com/forms/d/e/1FAIpQLSe5U3qvg8WHs4nkU-e6h2RlAD7fKoCkou6HO2w2-tXYIA_F8g/viewform'\n)\n\nconsole.log(result.fields)\n// will output the form fields in an appropriate structure\n// [\n//   {\n//     label: 'Do you want to give some feedback?',\n//     type: 'LONG_ANSWER',\n//     id: '1864908950',\n//     required: false\n//   },\n//   ...\n// ]\n```\n\nPass the form object to the `useGoogleForm` hook and wrap your form in a `GoogleFormProvider`. Then you can build your custom components to render the form as beautiful as you like.\n\n```javascript\nimport { GoogleFormProvider, useGoogleForm, useShortAnswerInput } from 'react-google-forms-hooks'\n\nimport form from './form.json'\n\nexport default function ShortAnswerInput({ id }) {\n  const { register, label } = useShortAnswerInput(id)\n\n  return (\n    \u003cdiv\u003e\n      \u003cp\u003e{label}\u003c/p\u003e\n      \u003cinput type='text' {...register()} /\u003e\n    \u003c/div\u003e\n  )\n}\n\n\nconst App = () =\u003e {\n  const methods = useGoogleForm({ form })\n  const onSubmit = async (data) =\u003e {\n    await methods.submitToGoogleForms(data)\n  }\n\n  return (\n    \u003cGoogleFormProvider {...methods}\u003e\n      \u003cForm onSubmit={methods.handleSubmit(onSubmit)}\u003e\n        \u003cShortAnswerInput id='1864908950' /\u003e\n        \u003cbutton type='submit'\u003eSubmit\u003c/button\u003e\n      \u003c/Form\u003e\n    \u003c/GoogleFormProvider\u003e\n  )\n}\n\nexport default App\n```\n\nYou can check a more complete example in the [example](https://github.com/francisconeves97/react-google-forms-hooks/blob/master/example/src/App.js) folder.\n\n## Caveats\n\n- Right now there is no observability on errors when submitting a form. See this [comment on the code](https://github.com/francisconeves97/react-google-forms-hooks/blob/ca5018e578cfb0e230f9be58dfeee4117db28160/src/hooks/useGoogleForm.ts#L61-L65).\n- You can use the `submitToGoogleForm` export to create a server to handle form submissions. This way you can mitigate the CORS problem.\n- No support for multi page, sections, images and other Google Forms functionalities. However you can build your React form with multiple pages, by saving the `data` from `handleSubmit` and only `submitToGoogleForms` on the last page.\n- The list of supported inputs doesn't feature every input from Google Forms. Supported inputs: Short Answer, Long Answer, Checkbox, Radio, Dropdown, Linear, Radio Grid, Checkbox Grid\n- Because of CORS you have to run the `googleFormsToJson` script in build time.\n\n## Contributing\n\nThis library was born as a result of a side project I did and it is tailored towards my needs. If you have suggestions/improvements/ideas feel free to open issues or PRs. :rocket:\n\n## Credits\n\nThis library was largely inspired on the work done by @cybercase on the [google-forms-html-exporter](https://github.com/cybercase/google-forms-html-exporter) repo.\n\n## License\n\nMIT © [francisconeves97](https://github.com/francisconeves97)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/juliangsibecas\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/25715495?v=4?s=100\" width=\"100px;\" alt=\"Julián Gómez Sibecas\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJulián Gómez Sibecas\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/francisconeves97/react-google-forms-hooks/commits?author=juliangsibecas\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://lumen.media\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/489221?v=4?s=100\" width=\"100px;\" alt=\"Dominic Garms\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDominic Garms\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-dohomi\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/francisconeves97/react-google-forms-hooks/commits?author=dohomi\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/kbalisnomo\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/42983430?v=4?s=100\" width=\"100px;\" alt=\"Kyle Philip Balisnomo\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKyle Philip Balisnomo\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/francisconeves97/react-google-forms-hooks/commits?author=kbalisnomo\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/francisconeves97/react-google-forms-hooks/issues?q=author%3Akbalisnomo\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/mikemajara\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/15649320?v=4?s=100\" width=\"100px;\" alt=\"mikemajara\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003emikemajara\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/francisconeves97/react-google-forms-hooks/commits?author=mikemajara\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-mikemajara\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/DanielOrtel\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/19431728?v=4?s=100\" width=\"100px;\" alt=\"Daniel Ferenc Balogh\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniel Ferenc Balogh\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/francisconeves97/react-google-forms-hooks/issues?q=author%3ADanielOrtel\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/bfrymire\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/20096702?v=4?s=100\" width=\"100px;\" alt=\"Brent Frymire\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBrent Frymire\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/francisconeves97/react-google-forms-hooks/commits?author=bfrymire\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancisconeves97%2Freact-google-forms-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrancisconeves97%2Freact-google-forms-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrancisconeves97%2Freact-google-forms-hooks/lists"}