{"id":16211582,"url":"https://github.com/ansub/loops.so-react-setup","last_synced_at":"2026-01-20T04:32:46.715Z","repository":{"id":190634810,"uuid":"683049381","full_name":"Ansub/loops.so-react-setup","owner":"Ansub","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-25T13:47:31.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-01T01:56:48.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/Ansub.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}},"created_at":"2023-08-25T13:27:43.000Z","updated_at":"2024-04-17T03:23:38.000Z","dependencies_parsed_at":"2023-08-25T17:57:23.950Z","dependency_job_id":null,"html_url":"https://github.com/Ansub/loops.so-react-setup","commit_stats":null,"previous_names":["ansub/loops.so-nextjs-setup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ansub/loops.so-react-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansub%2Floops.so-react-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansub%2Floops.so-react-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansub%2Floops.so-react-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansub%2Floops.so-react-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ansub","download_url":"https://codeload.github.com/Ansub/loops.so-react-setup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ansub%2Floops.so-react-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28596079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"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":[],"created_at":"2024-10-10T10:48:31.130Z","updated_at":"2026-01-20T04:32:46.699Z","avatar_url":"https://github.com/Ansub.png","language":null,"readme":"### Loops.so Implementation\nThis repository provides a simplified implementation of the [Luminary Newsletter](https://www.ansubkhan.com/newsletter) subscription form using the [Loops.so](https://loops.so/). It demonstrates how Loops.so can be integrated in react app, setup is straightforward.\n\n### Prerequisites\n\t•\tReact / Next.js\n\t•\tZod for validation\n\t•\tAxios for handling post requests\n \t•\tLoops Form Link\n\n### How to get Form Link?\n\n\nhttps://github.com/Ansub/loops.so-react-setup/assets/12985873/50c586e1-2f8a-4eb3-9121-a0ea45b897d1\n\n\n \t\n\n### Logic\n```typescript\nconst [email, setEmail] = useState\u003cstring\u003e(\"\");\n\n  const handleSubmit = async (event: React.FormEvent) =\u003e {\n    event.preventDefault();\n\n    try {\n      const validatedData = schema.parse({ email });\n\n      const formBody = `userGroup=${encodeURIComponent(\n        \"\"\n      )}\u0026email=${encodeURIComponent(validatedData.email)}`;\n\n      const res = await axios.post(\n        {\n          /**YOUR FORM LINK */\n        },\n        formBody,\n        {\n          headers: {\n            \"Content-Type\": \"application/x-www-form-urlencoded\",\n          },\n        }\n      );\n      if (res.status === 200 \u0026\u0026 res.data.success === true) {\n        setEmail(\"\");\n        alert(\"Thank you for subscribing to Luminary!\");\n      }\n    } catch (error) {\n      if (error instanceof z.ZodError) {\n        alert(\"Invalid email format. Please provide a valid email address.\");\n      } else if (error.response) {\n        alert(error.response.data.message);\n      } else if (error.message !== \"Failed to fetch\") {\n        alert(\"Something went wrong. Please try again later.\");\n      }\n    }\n  };\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansub%2Floops.so-react-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansub%2Floops.so-react-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansub%2Floops.so-react-setup/lists"}