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

@captcha-la/electron

v1.0.4

Published

Captchala CAPTCHA verification SDK for Electron

Readme

@captcha-la/electron

Captchala verification SDK for Electron desktop apps (Windows / macOS / Linux).

npm license

Links

Install

npm install @captcha-la/electron

Quick Start

const { CaptchalaClient } = require('@captcha-la/electron');

async function verifyCaptcha(serverToken) {
  const client = new CaptchalaClient({
    appKey: 'your_app_key',  // get yours at https://dash.captcha.la
    serverToken,
    lang: 'zh-CN',
    theme: 'light',
  });

  try {
    const result = await client.verify();
    console.log('pass_token:', result.passToken);
    // Send result.passToken to your backend for server-side validation
    return result;
  } catch (err) {
    if (err.message === 'captcha_dismissed') {
      console.log('User closed captcha');
    } else {
      console.error('Error:', err.message);
    }
  } finally {
    client.destroy();
  }
}

Note: verify() must be called from the main process (not renderer).

Getting your appKey

  1. Sign in at https://dash.captcha.la
  2. Create an app → copy the appKey
  3. Set up your backend to issue server_token via Captchala server API (see https://captcha.la/docs)

Integration flow

Your Backend                    Your Electron App                Captchala
     |                               |                              |
     |  1. Issue server_token        |                              |
     | <---------------------------> |                              |
     |                               |                              |
     |     2. CaptchalaClient.verify(serverToken)                   |
     |                               | ─── encrypted ticket ──────> |
     |                               | <── captcha challenge ────── |
     |                               |     (native window opens)    |
     |                               |                              |
     |     3. User completes captcha |                              |
     |                               | ─── pass_token ────────────> |
     |                               |                              |
     |  4. Validate pass_token       |                              |
     | <---------------------------> |                              |

API

See full reference at https://captcha.la/docs/sdk/electron.

new CaptchalaClient(config)

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | appKey | string | Yes | — | Get at https://dash.captcha.la | | serverToken | string | Yes* | — | One-time token from your backend | | action | string | No | "default" | Business action (e.g. "login") | | lang | string | No | "zh-CN" | UI language | | theme | string | No | "light" | "light" or "dark" | | timeoutMs | number | No | 15000 | HTTP timeout (ms) | | retryCount | number | No | 3 | Retries per server | | maskClosable | boolean | No | false | Allow dismiss by clicking outside | | enableOfflineMode | boolean | No | false | Fallback when servers unreachable | | account | string | No | — | User identifier for risk scoring | | onReady | function | No | — | Called when captcha is rendered | | onFail | function | No | — | Called on recoverable error (user can retry) |

* Required when your app is configured to require a server-issued token (see https://dash.captcha.la).

client.verify(): Promise<CaptchalaResult>

Starts the verification flow. A native captcha window opens automatically.

Resolves with:

{
  passToken: string;      // Submit to your backend for validation
  challengeId: string;    // Challenge identifier
  ttl: number;            // Token validity in seconds
  isOffline: boolean;     // true if verified offline
  isClientOnly: boolean;  // true if client-only verification
}

Rejects with:

  • Error('captcha_dismissed') — user closed the captcha
  • Error('code: message') — verification failed

Other methods

  • client.dismiss() — programmatically close the captcha
  • client.setServerToken(token) — update server token (refresh)
  • client.destroy() — release native resources
  • CaptchalaClient.version() — SDK version
  • CaptchalaClient.getDeviceId() / .getFingerprint() — device identifiers

Requirements

| Platform | Requirements | |----------|-------------| | Windows | Windows 10 (build 1809+) | | macOS | macOS 11+ | | Linux | Standard desktop libraries (GTK + libcurl) | | Node.js | 18+ | | Electron | 28+ |

Supported architectures

| Platform | Architectures | |----------|---------------| | Windows | x64 | | macOS | arm64 (Apple Silicon), x64 (Intel) | | Linux | x64, arm64 |

License

MIT — see LICENSE.