open-index/open-npm huggingface dataset:
npm package: @naughtbot/sdk
Description: NaughtBot captcha SDK — cryptographic proof of human interaction via biometric verification
Author: NaughtBot
Latest version: 0.3.4

# NaughtBot SDK

TypeScript SDK for the NaughtBot CAPTCHA widget. Provides cryptographic proof of human interaction via biometric verification.

## Install

```bash
npm install @naughtbot/sdk
```

## Usage

The SDK provides two entrypoints: `@naughtbot/sdk/browser` for client-side UI and `@naughtbot/sdk/server` for server-side proof verification.

### Browser — Widget

```ts
import { createWidget } from "@naughtbot/sdk/browser";

const widget = await createWidget("#captcha", {
  nonce: "server-generated-nonce",
  relayUrl: "https://relay.naughtbot.com",
  onVerified: (result) => {
    // Send result.proof to your server for verification
    fetch("/api/verify", {
      method: "POST",
      body: JSON.stringify(result),
    });
  },
});
```

### Browser — Headless Session

```ts
import { createSession } from "@naughtbot/sdk/browser";

const session = await createSession({
  nonce: "server-generated-nonce",
  relayUrl: "https://relay.naughtbot.com",
});

// Display session.qrCodeUrl as a QR code
const result = await session.waitForResult();
```

### Browser — BLE Transport

```ts
import { createBLESession, isBLEAvailable } from "@naughtbot/sdk/browser";

if (await isBLEAvailable()) {
  // Must be called from a user gesture (click handler)
  const session = await createBLESession({ nonce: "server-generated-nonce" });
  const result = await session.waitForResult();
}
```

### Server — Proof Verification

```ts
import { verifyCaptchaProof } from "@naughtbot/sdk/server";

const result = await verifyCaptchaProof(captchaResult, {
  issuerPublicKey: {
    keyId: "key-001",
    publicKey: "<base64url-encoded BLS12-381 G2 public key>",
  },
  expectedDomain: "example.com",
  logger: console, // optional, defaults to console
});

if (result.valid) {
  // Proof is valid
}
```

## Development

```bash
# Build
pnpm install && pnpm build

# Run tests
pnpm test

# Lint
pnpm lint
```

## Related Repos

- [ackagent/web-sdk](https://github.com/AckAgent/web-sdk) — AckAgent Web SDK (peer dependency)
- [naughtbot/api](https://github.com/naughtbot/api) — NaughtBot API types
- [naughtbot/relay](https://github.com/naughtbot/relay) — NaughtBot relay service

## License

MIT
npm package: @naughty/logger
Description: 命令行标准输出打印 logger
Author: Cphayim
Latest version: 1.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<!--
 * @Author: Cphayim
 * @Date: 2020-05-27 13:59:30
 * @LastEditTime: 2020-05-27 14:05:59
 * @Description:
-->
# @naughty/logger

## 如何安装

```sh
npm i @naughty/logger
```

## 如何使用

```js
import { Logger } from '@naughty/logger' // ESM
// 或 const { Logger } = require('@naughty/logger') // CommonJS

Logger.print(123) // 控制台打印普通输出，类似于 console.log
Logger.info(123) // 输出蓝色 '[信息]: 123'
Logger.info(123, {tip: '标签'}) // 输出蓝色 '[标签]: 123'
Logger.exec(123) // 输出青色 '[执行]: 123'
Logger.success(123) // 输出绿色 '[成功]: 123'
Logger.error(123) // 输出红色 '[错误]: 123'

// 默认 devOnly 为 true
// 仅在环境变量 process.env.NODE_ENV 为 'devlopment' 时打印信息
Logger.debug(123) // 输出黄色 '[调试]: 123'

// 在任何环境打印信息
Logger.debug(456, { devOnly: false }) // 输出黄色 '[调试]: 456'
```