{"id":15705606,"url":"https://github.com/edde746/svelte-captcha-enhance","last_synced_at":"2025-05-12T15:42:31.254Z","repository":{"id":179174184,"uuid":"663067258","full_name":"edde746/svelte-captcha-enhance","owner":"edde746","description":"Easily add captchas to SvelteKit forms","archived":false,"fork":false,"pushed_at":"2024-10-01T18:38:04.000Z","size":106,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T19:47:46.575Z","etag":null,"topics":["captcha","forms","hcaptcha","recaptcha","sveltekit","turnstile"],"latest_commit_sha":null,"homepage":"https://svelte-captcha-enhance.pages.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edde746.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-06T13:34:10.000Z","updated_at":"2025-03-23T16:39:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"4c50bc38-1538-4c81-b43b-1f2157d8ce43","html_url":"https://github.com/edde746/svelte-captcha-enhance","commit_stats":null,"previous_names":["edde746/svelte-recaptcha-enhance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edde746%2Fsvelte-captcha-enhance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edde746%2Fsvelte-captcha-enhance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edde746%2Fsvelte-captcha-enhance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edde746%2Fsvelte-captcha-enhance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edde746","download_url":"https://codeload.github.com/edde746/svelte-captcha-enhance/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249909209,"owners_count":21343937,"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","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":["captcha","forms","hcaptcha","recaptcha","sveltekit","turnstile"],"created_at":"2024-10-03T20:17:25.020Z","updated_at":"2025-04-20T14:30:40.336Z","avatar_url":"https://github.com/edde746.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-captcha-enhance\n\nA lightweight SvelteKit utility to easily add a captcha to your forms with progressive enhancement. Currently reCaptcha, hCaptcha and turnstile are supported.\n\n## Installation\n\nUse npm to install the `svelte-captcha-enhance` package:\n\n```bash\nnpm install svelte-captcha-enhance\n```\n\n## Example\n\nBelow is an example of how to use `svelte-captcha-enhance` in your SvelteKit application:\n\n```svelte\n\u003cscript\u003e\n  import { env } from '$env/dynamic/public';\n  import enhance from 'svelte-captcha-enhance';\n\u003c/script\u003e\n\n\u003csvelte:head\u003e\n  \u003cscript src=\"https://www.google.com/recaptcha/api.js?render={env.PUBLIC_SITEKEY}\"\u003e\u003c/script\u003e\n\u003c/svelte:head\u003e\n\n\u003cform\n  method=\"post\"\n  use:enhance={{\n    type: 'recaptcha',\n    sitekey: env.PUBLIC_SITEKEY,\n    submit:\n      ({ formData }) =\u003e\n      ({ result }) =\u003e {\n        alert(result.data.message);\n      }\n  }}\n\u003e\n  \u003cinput type=\"text\" name=\"name\" placeholder=\"Your name\" /\u003e\n  \u003cbutton\u003eSubmit\u003c/button\u003e\n\u003c/form\u003e\n```\n\nCheck [src/routes](https://github.com/edde746/svelte-captcha-enhance/tree/master/src/routes) for full examples of hCaptcha \u0026 Turnstile.\n\n## Usage\n\nYou'll need to get your `sitekey` from the desired captcha provider and include it in your environment variables (`PUBLIC_SITEKEY` in the example).\n\nThe `callback` function is the same as what would usually be passed to the `enhance` function ([documentation](https://kit.svelte.dev/docs/form-actions#progressive-enhancement)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedde746%2Fsvelte-captcha-enhance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedde746%2Fsvelte-captcha-enhance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedde746%2Fsvelte-captcha-enhance/lists"}