{"id":14962575,"url":"https://github.com/nexuspipe/uvc-frontend","last_synced_at":"2026-01-19T23:06:19.469Z","repository":{"id":195101533,"uuid":"692209063","full_name":"NexusPIPE/uvc-frontend","owner":"NexusPIPE","description":"Frictionless CAPTCHAs that work.","archived":false,"fork":false,"pushed_at":"2024-01-15T19:27:03.000Z","size":388,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-11T12:41:02.198Z","etag":null,"topics":["captcha","captcha-library","javascript","nexusuvc","svelte","svelte3","svelte4","sveltejs","sveltekit","sveltekit-library","typescript","uvc"],"latest_commit_sha":null,"homepage":"https://uvc.nexuspipe.com","language":"TypeScript","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/NexusPIPE.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-09-15T20:11:36.000Z","updated_at":"2023-11-04T19:07:42.000Z","dependencies_parsed_at":"2023-09-16T14:36:34.576Z","dependency_job_id":"eb9b218a-9cb9-44bd-9958-31d2827d6665","html_url":"https://github.com/NexusPIPE/uvc-frontend","commit_stats":null,"previous_names":["nexuspipe/uvc-frontend"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NexusPIPE%2Fuvc-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NexusPIPE%2Fuvc-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NexusPIPE%2Fuvc-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NexusPIPE%2Fuvc-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NexusPIPE","download_url":"https://codeload.github.com/NexusPIPE/uvc-frontend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222922905,"owners_count":17058410,"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","captcha-library","javascript","nexusuvc","svelte","svelte3","svelte4","sveltejs","sveltekit","sveltekit-library","typescript","uvc"],"created_at":"2024-09-24T13:30:02.824Z","updated_at":"2024-11-04T01:21:50.340Z","avatar_url":"https://github.com/NexusPIPE.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NexusUVC SDK: CAPTCHA's, done right](./social.png)](https://uvc.nexuspipe.com/)\n\n# UVC SDK\n\nThe UVC SDK for SvelteKit, Svelte and Plain HTML.\n\n## Table of Contents\n\n- [UVC SDK](#uvc-sdk)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Client Usage](#client-usage)\n    - [SvelteKit](#sveltekit)\n    - [Plain HTML](#plain-html)\n      - [With a preprocessor (like Parcel)](#with-a-preprocessor-like-parcel)\n        - [Event Listener](#event-listener)\n        - [Global-Scope Callback](#global-scope-callback)\n      - [Without a preprocessor](#without-a-preprocessor)\n    - [Options](#options)\n  - [Server Usage](#server-usage)\n\n## Installation\n\n```bash\npnpm i @nexusuvc/frontend\n```\n\n## Client Usage\n\n### SvelteKit\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n  import UVC from '@nexusuvc/frontend';\n\u003c/script\u003e\n\n\u003cUVC\n  publicKey=\"\u003cYour Public Key\u003e\"\n  options={{}}\n  on:completed={e =\u003e console.log('done with ticket', e.detail)}\n/\u003e\n```\n\n### Plain HTML\n\n#### With a preprocessor (like Parcel)\n\n##### Event Listener\n\n```html\n\u003cscript type=\"module\"\u003e\n  import '@nexusuvc/frontend/vanilla';\n\n  const uvc = document.querySelector('#your-uvc');\n  uvc.addEventListener('completed', e =\u003e {\n    console.log('done with ticket', e.detail);\n  });\n\u003c/script\u003e\n\n\u003cnexus-uvc publicKey=\"\u003cYour Public Key\u003e\" options=\"{}\" id=\"your-uvc\"\u003e\u003c/nexus-uvc\u003e\n```\n\n##### Global-Scope Callback\n\n```html\n\u003cscript type=\"module\"\u003e\n  import '@nexusuvc/frontend/vanilla';\n\n  // the completed function must live in the global scope - it's body cannot be passed to the event, and it cannot be something like console.log that doesn't directly live in the global scope\n  window.completedFunc = ticket =\u003e {\n    console.log('done with ticket', ticket);\n  };\n\u003c/script\u003e\n\n\u003cnexus-uvc\n  publicKey=\"\u003cYour Public Key\u003e\"\n  options=\"{}\"\n  onCompleted=\"completedFunc\"\n\u003e\u003c/nexus-uvc\u003e\n```\n\n#### Without a preprocessor\n\nSame as above, but use `https://unpkg.com/@nexusuvc/frontend@^1.0.0/vanilla/index.js` instead of `@nexusuvc/frontend/vanilla`.\n\n### Options\n\nYou can find the options type [here](https://github.com/NexusPIPE/uvc-frontend/blob/master/src/lib/sdk/Options.ts) under `export type UVCOptions = ...`\n\n## Server Usage\n\n```ts\n/** Validation Request Function */\nconst performValidation = async (privateKey: string, ticket: string) =\u003e\n  (await fetch(\n    `https://uvc.nexuspipe.com/uvc/evaluate/${encodeURIComponent(\n      privateKey,\n    )}/${encodeURIComponent(ticket)}`,\n  )\n    .then(r =\u003e\n      r.ok\n        ? r.json()\n        : {\n            success: false,\n            challenge_ts: '',\n            hostname: '',\n            'error-codes': [],\n            'internal-cause': new Error('Invalid response from UVC server'),\n            response: r,\n          },\n    )\n    .catch(e =\u003e ({\n      success: false,\n      challenge_ts: '',\n      hostname: '',\n      'error-codes': [],\n      'internal-cause': e,\n    }))) as Promise\u003c\n    | {\n        success: false;\n        challenge_ts: '';\n        hostname: '';\n        'error-codes': number[];\n        'internal-cause'?: Error;\n        response?: Response;\n      }\n    | {\n        success: true;\n        challenge_ts: number;\n        hostname: string;\n        'error-codes': [];\n      }\n  \u003e;\n/** Validation Function */\nconst validate = async (privateKey: string, ticket: string) =\u003e\n  (await performValidation(privateKey, ticket)).success;\n```\n\nYou can implement this in any language, but the above is a TypeScript example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexuspipe%2Fuvc-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnexuspipe%2Fuvc-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnexuspipe%2Fuvc-frontend/lists"}