Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@captigo/core

Core types and adapter contracts for Captigo — a provider-agnostic CAPTCHA integration layer.

This package defines the shared types and the CaptchaAdapter / CaptchaWidget interfaces that every captigo provider implements. You usually install it alongside a provider package (Turnstile, hCaptcha, reCAPTCHA); it is also pulled in automatically as a dependency of those adapters.

Use @captigo/core directly when you want to depend only on types, write helper code against CaptchaAdapter, or share configuration between client and server without importing a specific provider.


Installation

npm install @captigo/core

Most apps install an adapter as well; @captigo/core is also installed automatically as a dependency of @captigo/turnstile, @captigo/hcaptcha, @captigo/recaptcha, @captigo/react, @captigo/vue, and @captigo/nextjs.

npm install @captigo/core @captigo/turnstile

What this package exports

  • Types: CaptchaToken, VerifyResult, VerifyOptions, AdapterMeta, CaptchaMode, ProviderId, and related configuration types.
  • Contracts: CaptchaAdapter, CaptchaWidget, RenderOptions, WidgetCallbacks, AdapterFactory.
  • Errors: CaptchaError and CaptchaErrorCode.

See the TypeScript definitions in dist/index.d.ts after build for the full API.


Typical usage

Provider factories return a CaptchaAdapter. Your app passes that adapter to framework integrations (@captigo/react, @captigo/vue) or calls adapter.render / adapter.verify yourself:

import type { CaptchaAdapter } from "@captigo/core";
import { turnstile } from "@captigo/turnstile";

const adapter: CaptchaAdapter = turnstile({ siteKey: "..." });

Caveats

  • This package has no widget UI. Use a provider adapter plus @captigo/react, @captigo/vue, or your own adapter.render() integration.
  • Secrets never belong in client bundles. Use each adapter’s server-side verify / verifyToken from your backend only.

Documentation

Monorepo overview · Source · Issues