{"id":44633663,"url":"https://github.com/dethdkn/nuxt-cap","last_synced_at":"2026-02-17T20:01:22.769Z","repository":{"id":338347791,"uuid":"1157608970","full_name":"dethdkn/nuxt-cap","owner":"dethdkn","description":"🧢 Integrate Cap into your Nuxt websites/applications.","archived":false,"fork":false,"pushed_at":"2026-02-14T15:36:16.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-14T23:32:55.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Vue","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/dethdkn.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-14T03:07:19.000Z","updated_at":"2026-02-14T15:36:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dethdkn/nuxt-cap","commit_stats":null,"previous_names":["dethdkn/nuxt-cap"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dethdkn/nuxt-cap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dethdkn%2Fnuxt-cap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dethdkn%2Fnuxt-cap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dethdkn%2Fnuxt-cap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dethdkn%2Fnuxt-cap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dethdkn","download_url":"https://codeload.github.com/dethdkn/nuxt-cap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dethdkn%2Fnuxt-cap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29556406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T18:16:07.221Z","status":"ssl_error","status_checked_at":"2026-02-17T18:16:04.782Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":"2026-02-14T17:15:41.166Z","updated_at":"2026-02-17T20:01:22.763Z","avatar_url":"https://github.com/dethdkn.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003enuxt-cap\u003c/h1\u003e\n\u003cp align=\"center\"\u003e🧢 Integrate Cap into your Nuxt websites/applications.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://rosa.dev.br\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/check me!-👻-F28AA9\" alt=\"rosa.dev.br\"/\u003e\n   \u003c/a\u003e\n   \u003ca href=\"https://github.com/dethdkn/nuxt-cap/blob/main/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/dethdkn/nuxt-cap?color=%233da639\u0026logo=open%20source%20initiative\" alt=\"License\"/\u003e\n  \u003c/a\u003e\n   \u003ca href=\"https://gitmoji.dev\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67\" alt=\"Gitmoji\"/\u003e\n   \u003c/a\u003e\n\u003c/p\u003e\n\n## 🚀 Setup\n\nInstall `nuxt-cap` dependency to your project:\n\n```sh\nnpx nuxt module add nuxt-cap\n```\n\n## ⚙️ Configuration\n\nYou can configure **nuxt-cap** in two ways:\n\n### 1️⃣ Using `nuxt.config.ts`\n\nSet the `apiEndpoint` directly in your Nuxt configuration:\n\n```ts\nexport default defineNuxtConfig({\n  cap: {\n    apiEndpoint: 'https://cap.example.com/\u003cKEY\u003e/',\n  },\n})\n```\n\n---\n\n### 2️⃣ Using an Environment Variable (Recommended)\n\n```bash\nNUXT_PUBLIC_CAP_API_ENDPOINT=\"https://cap.example.com/\u003cKEY\u003e/\"\n```\n\nBecause this uses **Nuxt runtimeConfig**, it supports runtime environment variables — meaning you can change the endpoint **after build time** without rebuilding your application.\n\n## 🧩 `\u003cCap /\u003e` Component\n\nThis module auto-imports a component called:\n\n```vue\n\u003cCap /\u003e\n```\n\n---\n\n## 📡 Emits\n\nThe component exposes four events:\n\n- `@solve`\n- `@error`\n- `@reset`\n- `@progress`\n\n### Example\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\n  function onSolve(event: CapSolveEvent): void {\n    console.log('Solved:', event)\n  }\n\n  function onError(event: CapErrorEvent): void {\n    console.error('Error:', event)\n  }\n\n  function onReset(event: CapResetEvent): void {\n    console.log('Reset:', event)\n  }\n\n  function onProgress(event: CapProgressEvent): void {\n    console.log('Progress:', event)\n  }\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cCap @solve=\"onSolve\" @error=\"onError\" @reset=\"onReset\" @progress=\"onProgress\" /\u003e\n\u003c/template\u003e\n```\n\n## 🧱 Props\n\n### `workerCount?: number`\n\nOptional.\n\nDefines how many Web Workers Cap should use to solve the proof-of-work challenge.\n\nIf not set, Cap defaults to:\n\n```ts\nnavigator.hardwareConcurrency || 8\n```\n\n---\n\n### `i18n?: object`\n\nOptional.\n\nAllows you to customize the widget language.\n\n```ts\n{\n  verifyingLabel?: string\n  initialState?: string\n  solvedLabel?: string\n  errorLabel?: string\n  wasmDisabled?: string\n  verifyAriaLabel?: string\n  verifyingAriaLabel?: string\n  verifiedAriaLabel?: string\n  errorAriaLabel?: string\n}\n```\n\n### Example\n\n```vue\n\u003ctemplate\u003e\n  \u003cCap\n    :worker-count=\"4\"\n    :i18n=\"{\n      verifyingLabel: 'Verificando...',\n      solvedLabel: 'Verificado',\n      errorLabel: 'Erro',\n    }\" /\u003e\n\u003c/template\u003e\n```\n\n## 🎨 Customizing Appearance\n\nTo customize Cap’s appearance, follow the official Cap widget customization guide:\n[Customizing](https://capjs.js.org/guide/widget.html#customizing)\n\n## 🔄 Reset\n\nTo reset the Cap widget programmatically, you can use the provided helper function:\n\n```ts\nresetCap()\n```\n\n### Example\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\n  function handleReset(): void {\n    // ...anything\n    resetCap()\n  }\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cbutton @click=\"handleReset\"\u003eReset Cap\u003c/button\u003e\n\n  \u003cCap /\u003e\n\u003c/template\u003e\n```\n\nCalling `resetCap()` will reset the current widget state, allowing the challenge to be solved again.\n\n## 👻 Invisible Mode\n\nFor invisible mode, you can use the `useCap()` composable.\n\nIt returns a Cap instance, similar to the one described in the official invisible guide:\n\n[Guide](https://capjs.js.org/guide/invisible.html)\n\nYou can call any available Cap instance method, such as `cap.solve()`.\n\n### Example\n\n```vue\n\u003cscript setup lang=\"ts\"\u003e\n  const cap = useCap()\n\n  async function testCap(): Promise\u003cvoid\u003e {\n    if (!cap) return\n\n    const { token } = await cap.solve()\n    console.log(token)\n  }\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cbutton @click=\"testCap\"\u003eSolve Invisible Cap\u003c/button\u003e\n\u003c/template\u003e\n```\n\nThis allows you to manually trigger the proof-of-work challenge without rendering the `\u003cCap /\u003e` checkbox widget.\n\n## 📝 License\n\nCopyright © 2026 [Gabriel 'DethDKN' Rosa](https://github.com/dethdkn)\\\nThis project is under [MIT license](https://github.com/dethdkn/nuxt-cap/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdethdkn%2Fnuxt-cap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdethdkn%2Fnuxt-cap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdethdkn%2Fnuxt-cap/lists"}