open-index/open-npm huggingface dataset:
npm package: @gkatsev/grunt-sass
Description: Compile Sass to CSS using node-sass
Author: Sindre Sorhus
Latest version: 1.1.1

# grunt-sass [![Build Status](https://travis-ci.org/sindresorhus/grunt-sass.svg?branch=master)](https://travis-ci.org/sindresorhus/grunt-sass)

[<img src="https://rawgit.com/sass/node-sass/master/media/logo.svg" width="200" align="right">](https://github.com/sass/node-sass)

> Compile Sass to CSS using [node-sass](https://github.com/sass/node-sass)

*Issues with the output should be reported on the libsass [issue tracker](https://github.com/hcatlin/libsass/issues).*

This task uses [libsass](http://libsass.org) which is a Sass compiler in C++. In contrast to the original Ruby compiler, this one is much faster, but is [missing some features](http://sass-compatibility.github.io/), though improving quickly. It also doesn't support Compass. Check out [grunt-contrib-sass](https://github.com/gruntjs/grunt-contrib-sass) if you prefer something more stable, but slower.


## Install

```
$ npm install --save-dev grunt-sass
```


## Usage

```js
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks

grunt.initConfig({
	sass: {
		options: {
			sourceMap: true
		},
		dist: {
			files: {
				'main.css': 'main.scss'
			}
		}
	}
});

grunt.registerTask('default', ['sass']);
```

Files starting with `_` are ignored to match the expected [Sass partial behaviour](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#partials).


## Options

See the `node-sass` [options](https://github.com/sass/node-sass#options), except for `file`, `outFile`, `success`, `error`.

The default value for the `precision` option is `10`, so you don't have to change it when using Bootstrap.


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)
npm package: @gkcaptcha/m2m
Description: Machine-to-machine (M2M) Node.js SDK for gkCAPTCHA — server-side PoW solving with built-in token caching
Latest version: 0.1.0

# @gkcaptcha/m2m

Machine-to-machine verification for gkCAPTCHA. Solve proof-of-work challenges server-side and obtain short-lived verification tokens without any browser interaction.

## Installation

```bash
npm install @gkcaptcha/m2m
```

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `GKCAPTCHA_API_URL` | Yes (or pass `apiUrl`) | Base URL for the gkCAPTCHA API (e.g. `https://api.gatekeeper.sa`) |

## Usage

```typescript
import { verifyM2M } from '@gkcaptcha/m2m'

const result = await verifyM2M({
  siteKey: 'pk_live_your_site_key',
  secretKey: 'sk_live_your_secret_key',
  apiUrl: 'https://api.gatekeeper.sa', // or set GKCAPTCHA_API_URL
})

if (result.success) {
  console.log('Token:', result.token)
  console.log('Expires at:', result.expiresAt)
} else {
  console.error('Verification failed:', result.reasonCode)
}
```

## Middleware

Express middleware that automatically verifies M2M tokens on incoming requests:

```typescript
import express from 'express'
import { createM2MMiddleware } from '@gkcaptcha/m2m'

const app = express()

app.use(
  '/api/protected',
  createM2MMiddleware({
    siteKey: 'pk_live_your_site_key',
    secretKey: 'sk_live_your_secret_key',
    apiUrl: 'https://api.gatekeeper.sa',
  })
)

app.post('/api/protected/data', (req, res) => {
  res.json({ message: 'Authenticated via M2M' })
})
```

## How It Works

The M2M SDK fetches a proof-of-work challenge, solves it server-side using SHA-256, and submits the solution for a short-lived token. The solve loop has a configurable iteration cap (default 10 million) to prevent infinite loops on unreasonable difficulty levels.

## Token Caching

Tokens are cached by default. Pass `cache: false` to disable:

```typescript
const result = await verifyM2M({
  siteKey: 'pk_live_your_site_key',
  secretKey: 'sk_live_your_secret_key',
  cache: false,
})
```
npm package: @gkcaptcha/next
Description: Next.js integration for gkCAPTCHA
Latest version: 0.1.0

# @gkcaptcha/next

Next.js integration for gkCAPTCHA. Provides a Client Component and a Server Action helper.

## Requirements

- Next.js >= 14
- React >= 18

## Installation

```bash
npm install @gkcaptcha/next
```

## Environment Variables

Add to `.env.local`:

```bash
GKCAPTCHA_SITE_KEY=pk_live_...
GKCAPTCHA_SECRET_KEY=sk_live_...
# Optional: override API URL (defaults to https://gkcaptcha.gatekeeper.sa)
# GKCAPTCHA_API_URL=https://gkcaptcha.gatekeeper.sa
```

## Quickstart

### Client Component

```tsx
// app/login/page.tsx
'use client'
import { GkCaptcha } from '@gkcaptcha/next'

export default function LoginPage() {
  return (
    <form action={loginAction}>
      <GkCaptcha
        siteKey={process.env.NEXT_PUBLIC_GKCAPTCHA_SITE_KEY!}
      />
      {/* Auto-injects <input name="gk-captcha-token"> when CAPTCHA passes */}
      <button type="submit">Login</button>
    </form>
  )
}
```

### Server Action

```typescript
// app/actions/login.ts
'use server'
import { verifyCaptchaToken } from '@gkcaptcha/next/server'

export async function loginAction(formData: FormData) {
  const token = formData.get('gk-captcha-token') as string
  const result = await verifyCaptchaToken(token)

  if (!result.success) {
    return { error: 'CAPTCHA verification failed' }
  }

  // Proceed with login...
}
```

### API Route

```typescript
// app/api/auth/route.ts
import { verifyCaptchaToken } from '@gkcaptcha/next/server'

export async function POST(request: Request) {
  const body = await request.json()
  const result = await verifyCaptchaToken(body.captchaToken)

  if (!result.success) {
    return Response.json({ error: 'CAPTCHA failed' }, { status: 403 })
  }

  // Proceed...
}
```

## Import Paths

| Import | Use In | Contains |
|--------|--------|---------|
| `@gkcaptcha/next` | Client Components | `GkCaptcha`, `useGkCaptcha` |
| `@gkcaptcha/next/server` | Server Actions, API Routes | `verifyCaptchaToken` |

**Never import from `@gkcaptcha/next/server` in a Client Component.** It reads server-only env vars.

## Props

See `@gkcaptcha/react` README for the full prop table — `GkCaptcha` has the same API.
npm package: @gkcaptcha/node
Description: Node.js server SDK for gkCAPTCHA token verification
Latest version: 0.1.0

# @gkcaptcha/node

Node.js server SDK for gkCAPTCHA token verification.

## Requirements

- Node.js >= 18 (or Bun / Deno)
- Zero runtime dependencies (uses native `fetch`)

## Installation

```bash
npm install @gkcaptcha/node
```

## Quickstart

### GatekeeperClient (recommended for apps with frequent verification)

```typescript
import { GatekeeperClient } from '@gkcaptcha/node'

// Create once, reuse across requests
const gatekeeper = new GatekeeperClient({
  siteKey: process.env.GKCAPTCHA_SITE_KEY!,
  secretKey: process.env.GKCAPTCHA_SECRET_KEY!,
})

// In your route handler:
const result = await gatekeeper.verifyToken(captchaToken)
if (!result.success) {
  return res.status(403).json({ error: 'CAPTCHA verification failed' })
}
```

### createGatekeeper (reads env vars automatically)

```typescript
import { createGatekeeper } from '@gkcaptcha/node'

// Reads GKCAPTCHA_SITE_KEY and GKCAPTCHA_SECRET_KEY from process.env
const gatekeeper = createGatekeeper()

const result = await gatekeeper.verifyToken(captchaToken)
```

### verifyToken (standalone, one-shot)

```typescript
import { verifyToken } from '@gkcaptcha/node'

const result = await verifyToken(captchaToken, {
  siteKey: process.env.GKCAPTCHA_SITE_KEY!,
  secretKey: process.env.GKCAPTCHA_SECRET_KEY!,
})
```

## Response Shape

```typescript
interface VerifyTokenResponse {
  success: boolean       // true = valid token, false = invalid or error
  score: number          // 0.0 (human) to 1.0 (bot)
  timestamp: number      // Unix timestamp of token creation
  reasonCode?: string    // Why verification failed (if success=false)
}
```

## Fail-Closed Behavior

All errors (network failure, timeout, 5xx server errors) return `{ success: false }` — they never throw. This ensures your application stays secure when the CAPTCHA service is unreachable.

## Environment Variables

| Variable | Required | Description |
|----------|----------|-------------|
| `GKCAPTCHA_SITE_KEY` | Yes | Site key from gatekeeper.sa dashboard |
| `GKCAPTCHA_SECRET_KEY` | Yes | Secret key from gatekeeper.sa dashboard |
| `GKCAPTCHA_API_URL` | No | Override API URL (default: `https://gkcaptcha.gatekeeper.sa`) |

## Options

```typescript
new GatekeeperClient({
  siteKey: '...',
  secretKey: '...',
  apiUrl: 'https://gkcaptcha.gatekeeper.sa', // default
  timeout: 5000,   // ms, default: 5000
  retries: 1,      // default: 1
  debug: false,    // logs requests (never logs secrets), default: false
})
```
npm package: @gkcaptcha/react
Description: React wrapper for the gkCAPTCHA Web Component
Latest version: 0.1.0

# @gkcaptcha/react

React wrapper for the gkCAPTCHA Web Component.

## Requirements

- React >= 18
- Node.js >= 18

## Installation

```bash
npm install @gkcaptcha/react
```

## Quickstart

```tsx
import { GkCaptcha } from '@gkcaptcha/react'

export function LoginForm() {
  const handleVerify = async (token: string) => {
    // Send token to your server for verification
    const res = await fetch('/api/login', {
      method: 'POST',
      body: JSON.stringify({ captchaToken: token }),
    })
  }

  return (
    <form>
      <GkCaptcha
        siteKey="pk_live_your_site_key"
        onVerify={handleVerify}
      />
      <button type="submit">Login</button>
    </form>
  )
}
```

## Imperative API

```tsx
import { GkCaptcha, useGkCaptcha } from '@gkcaptcha/react'

export function InvisibleCaptcha() {
  const { ref, execute, reset } = useGkCaptcha()

  return (
    <>
      <GkCaptcha
        ref={ref}
        siteKey="pk_live_your_site_key"
        mode="invisible"
        onVerify={(token) => console.log('token:', token)}
      />
      <button onClick={() => execute()}>Verify Me</button>
    </>
  )
}
```

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `siteKey` | `string` | required | Site key from gatekeeper.sa dashboard |
| `onVerify` | `(token: string) => void` | — | Called when CAPTCHA passes |
| `onError` | `(error: string) => void` | — | Called on widget error |
| `onExpire` | `() => void` | — | Called when token expires |
| `mode` | `'checkbox' \| 'invisible' \| 'overlay'` | `'checkbox'` | Widget display mode |
| `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Color theme |
| `size` | `'normal' \| 'compact'` | `'normal'` | Widget size |
| `lang` | `string` | auto | Language code (e.g., `'ar'`, `'en'`) |
| `baseUrl` | `string` | CDN URL | Override widget CDN base URL |
| `disabled` | `boolean` | `false` | Disable pointer events |

## Environment Variables

The component uses the CDN at `https://gkcaptcha.gatekeeper.sa/widget` by default.
Override with the `baseUrl` prop for development:

```tsx
<GkCaptcha
  siteKey="pk_test_..."
  baseUrl="https://gkcaptcha.gatekeeper.sa/widget"
  onVerify={handleVerify}
/>
```
npm package: @gkcaptcha/types
Description: Shared TypeScript types and error codes for gkCAPTCHA SDKs
Latest version: 0.1.0

# @gkcaptcha/types

Shared TypeScript types and error codes for gkCAPTCHA SDK packages.

## Installation

```bash
npm install @gkcaptcha/types
```

## Types

```typescript
import type {
  VerifyTokenRequest,
  VerifyTokenResponse,
  ReasonCode,
  GkCaptchaProps,
  GkCaptchaRef,
} from '@gkcaptcha/types'
```

## Error Codes

```typescript
import { ErrorCodes, isBotRejection, isChallengeFailure, isServerError } from '@gkcaptcha/types'

// Widget error code categories
isBotRejection(ErrorCodes.BOT_CDP_DETECTED)    // true (3xx)
isChallengeFailure(ErrorCodes.CHALLENGE_FAILED) // true (4xx)
isServerError(ErrorCodes.RATE_LIMITED)          // true (5xx)
```

## GkCaptchaProps

Key props shared by `@gkcaptcha/react` and `@gkcaptcha/vue`:

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `siteKey` | `string` | required | Site key from gatekeeper.sa dashboard |
| `onVerify` | `(token: string) => void` | — | Called when CAPTCHA passes |
| `onError` | `(error: string) => void` | — | Called on widget error |
| `onExpire` | `() => void` | — | Called when token expires |
| `mode` | `'checkbox' \| 'invisible' \| 'overlay'` | `'checkbox'` | Widget display mode |
| `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Color theme |
| `size` | `'normal' \| 'compact'` | `'normal'` | Widget size |
| `lang` | `string` | auto | Language code (e.g., `'ar'`, `'en'`) |
| `disabled` | `boolean` | `false` | Disable pointer events |

## VerifyTokenResponse

Returned by `@gkcaptcha/node` and `@gkcaptcha/next/server`:

```typescript
interface VerifyTokenResponse {
  success: boolean       // true = valid token, false = invalid or error
  score: number          // 0.0 (human) to 1.0 (bot)
  timestamp: number      // Unix timestamp of token creation
  reasonCode?: string    // Why verification failed (if success=false)
}
```

## Version

0.1.0 — part of the gkCAPTCHA SDK suite (`@gkcaptcha/*`).
npm package: @gkcaptcha/vue
Description: Vue 3 wrapper for the gkCAPTCHA Web Component
Latest version: 0.1.0

# @gkcaptcha/vue

Vue 3 wrapper for the gkCAPTCHA Web Component.

## Requirements

- Vue >= 3.3
- Node.js >= 18

## Installation

```bash
npm install @gkcaptcha/vue
```

## Quickstart

```typescript
// main.ts
import { createApp } from 'vue'
import { GkCaptcha } from '@gkcaptcha/vue'
import App from './App.vue'

const app = createApp(App)
app.component('GkCaptcha', GkCaptcha)
app.mount('#app')
```

```vue
<!-- LoginForm.vue -->
<template>
  <form @submit.prevent="handleSubmit">
    <GkCaptcha
      site-key="pk_live_your_site_key"
      @verify="onCaptchaVerify"
    />
    <button type="submit">Login</button>
  </form>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { GkCaptcha } from '@gkcaptcha/vue'

const captchaToken = ref('')

function onCaptchaVerify(token: string) {
  captchaToken.value = token
}

async function handleSubmit() {
  await fetch('/api/login', {
    method: 'POST',
    body: JSON.stringify({ captchaToken: captchaToken.value }),
  })
}
</script>
```

## Composable

```typescript
import { GkCaptcha, useGkCaptcha } from '@gkcaptcha/vue'

const { captchaRef, execute, reset } = useGkCaptcha()
// <GkCaptcha :ref="captchaRef" site-key="..." @verify="..." />
```

## Events

| Event | Payload | Description |
|-------|---------|-------------|
| `@verify` | `token: string` | CAPTCHA passed |
| `@error` | `error: string` | Widget error |
| `@expire` | — | Token expired |

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `siteKey` | `string` (required) | -- | Your gkCAPTCHA site key |
| `mode` | `'checkbox' \| 'overlay' \| 'invisible'` | `'checkbox'` | Widget mode |
| `theme` | `'light' \| 'dark' \| 'auto'` | `'auto'` | Color theme |
| `size` | `'normal' \| 'compact'` | `'normal'` | Widget size |
| `lang` | `string` | -- | Language code |
| `baseUrl` | `string` | (production CDN) | Widget script URL base |
| `challengeUrl` | `string` | -- | Override challenge endpoint |
| `verifyUrl` | `string` | -- | Override verify endpoint |
| `disabled` | `boolean` | `false` | Disable interaction |
| `trigger` | `'' \| 'onsubmit' \| 'onfocus' \| 'onload' \| 'managed'` | -- | Challenge trigger |
| `autoExecute` | `boolean` | `false` | Auto-start invisible mode |
| `disableRefetchOnExpire` | `boolean` | `false` | Don't refetch on expire |
| `refreshBuffer` | `number` | -- | Buffer seconds before expiry refetch |