npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@putin007/att-captcha-sdk-core

v0.1.4

Published

`@putin007/att-captcha-sdk-core` is the headless orchestration layer. It owns verification session state, provider orchestration, backend calls, and event emission.

Readme

@putin007/att-captcha-sdk-core

@putin007/att-captcha-sdk-core is the headless orchestration layer. It owns verification session state, provider orchestration, backend calls, and event emission.

Public API

Core

  • initAttCapchaSdk(options)
  • FrontendSdk
  • MemoryStateManager
  • SessionStorageStateManager
  • LocalStorageStateManager

The React and Vue demo apps in this repo consume backend endpoints from the delivery config exported by the SDK itself, instead of hardcoded 127.0.0.1:9001 values or direct client-side env reads.

Integrations

  • createGoCaptchaPuzzleAdapter(options)
  • createGoCaptchaDirectBackendAdapter(options)
  • createJsonGatewayAdapter(options)
  • createUnifiedGatewayAdapter(options)
  • createPowProvider(options)
  • createReCaptchaAdapter(options)

Example: current repo backend

import {
  GO_CAPTCHA_CHALLENGE_TYPES,
  initAttCapchaSdk,
  createGoCaptchaDirectBackendAdapter,
  createGoCaptchaPuzzleAdapter,
} from '@putin007/att-captcha-sdk-core'

const sdk = initAttCapchaSdk({
  config: {
    mode: 'puzzle',
  },
  puzzleAdapter: createGoCaptchaPuzzleAdapter({
    type: 'click',
    challengeEndpoint: '/api/go-captcha-data/click-basic',
    config: {
      type: GO_CAPTCHA_CHALLENGE_TYPES.CLICK_BASIC,
    },
  }),
  stateManager: new SessionStorageStateManager('demo.click-basic'),
  backendAdapter: createGoCaptchaDirectBackendAdapter({
    verifyEndpoint: '/api/go-captcha-check-data/click-basic',
    includeArtifacts: true,
  }),
})

await sdk.loadPuzzle()
await sdk.verify({
  puzzleInput: [
    { x: 18, y: 42 },
    { x: 102, y: 60 },
  ],
})

Example: unified gateway

import {
  GO_CAPTCHA_CHALLENGE_TYPES,
  SessionStorageStateManager,
  initAttCapchaSdk,
  createGoCaptchaPuzzleAdapter,
  createPowProvider,
  createReCaptchaAdapter,
  createUnifiedGatewayAdapter,
} from '@putin007/att-captcha-sdk-core'

const sdk = initAttCapchaSdk({
  config: {
    mode: 'puzzle',
  },
  powProvider: createPowProvider({
    loadChallenge: async () => ({
      salt: 'pow-salt',
      difficulty: 18,
    }),
  }),
  reCaptchaAdapter: createReCaptchaAdapter({
    siteKey: 'your-site-key',
    mode: 'v3',
    action: 'captcha_verify',
  }),
  puzzleAdapter: createGoCaptchaPuzzleAdapter({
    type: 'slide',
    challengeEndpoint: '/api/go-captcha-data/slide-basic',
    config: {
      type: GO_CAPTCHA_CHALLENGE_TYPES.SLIDE_BASIC,
    },
  }),
  stateManager: new SessionStorageStateManager('demo.gateway.slide-basic'),
  backendAdapter: createUnifiedGatewayAdapter({
    endpoint: '/api/captcha/verify',
  }),
})

GoCaptcha variant config

createGoCaptchaPuzzleAdapter() supports config.type so the frontend can tell the backend which captcha variant should be returned.

initAttCapchaSdk() supports config.mode with puzzle, pow, and recaptcha. For backward compatibility, the SDK also accepts the legacy alias recapcha and normalizes it to the internal recaptcha mode. Only the active provider path for that instance is auto-run when config.mode is set.

Supported values:

  • click_basic
  • click_shape
  • slide_basic
  • slide_region
  • rotate_basic
  • random

Example:

const sdk = initAttCapchaSdk({
  config: {
    mode: 'puzzle',
  },
  puzzleAdapter: createGoCaptchaPuzzleAdapter({
    type: 'random',
    challengeEndpoint: '/api/go-captcha-data',
    config: {
      type: GO_CAPTCHA_CHALLENGE_TYPES.RANDOM,
    },
  }),
  backendAdapter: createUnifiedGatewayAdapter({
    endpoint: '/api/captcha/verify',
  }),
})

When config.type is random, the backend should return the actual captcha type in the challenge payload via captcha_type, captchaType, challenge_type, challengeType, or type so the SDK can render and submit the correct widget.

Unified gateway contract

type UnifiedCaptchaGatewayRequest = {
  schemaVersion: 'att.captcha-gateway.v1'
  session: {
    id: string
  }
  artifacts: {
    pow?: PowProof
    recaptcha?: ReCaptchaAssertion
    puzzle?: PuzzleSubmission
  }
  metadata?: Record<string, unknown>
}

type UnifiedCaptchaGatewayResponse = {
  schemaVersion: 'att.captcha-gateway.v1'
  success: boolean
  token?: string
  message?: string
  errorCode?: string
  nextAction?: 'retry' | 'refresh-puzzle' | 'refresh-session'
  metadata?: Record<string, unknown>
}