open-index/open-npm huggingface dataset:
npm package: @subgames/sdk
Description: Official browser SDK for sub.games tier-gating
Latest version: 1.0.10

# @subgames/sdk

Official browser SDK for [sub.games](https://sub.games) tier-gating.

## Install

```bash
npm install @subgames/sdk
```

Or load it directly in the browser:

```html
<script src="https://sdk.sub.games/sdk.js"></script>
```

## Quick Start

```ts
import { SubGamesSDK } from '@subgames/sdk';

const sdk = SubGamesSDK.init({
  gameKey: 'my-platformer',
  overlay: true,
});
```

CDN usage:

```html
<script src="https://sdk.sub.games/sdk.js"></script>
<script>
  const sdk = SubGames.SubGamesSDK.init({
    gameKey: 'my-platformer',
    overlay: true,
  });
</script>
```

The CDN bundle is exposed on `window.SubGames.SubGamesSDK`.

## Features

- Tier-gating for `free`, `supporter`, and `founder`
- Login and subscribe prompts
- Pause and unpause events around modal flows
- Browser bundle for script-tag integrations

## Docs

- Browser SDK docs: https://sub.games/docs/sdk/browser-sdk
- React SDK docs: https://sub.games/docs/sdk/react-sdk
- Server SDK docs: https://sub.games/docs/sdk/server-sdk
npm package: @subgames/server-sdk
Description: Official server SDK for sub.games tier verification
Latest version: 1.0.3

# @subgames/server-sdk

Official server SDK for [sub.games](https://sub.games) tier verification.

## Install

```bash
npm install @subgames/server-sdk
```

## Quick Start

```ts
import { SubGamesServer } from '@subgames/server-sdk';

const server = SubGamesServer.init({
  apiKey: process.env.SUBGAMES_API_KEY!,
  apiSecret: process.env.SUBGAMES_API_SECRET!,
});
```

Verify a player token from the browser SDK:

```ts
const { email, tier } = await server.verifyPlayerTier(playerToken);
```

Check whether a player has access to a tier:

```ts
const allowed = await server.checkAccess('player@example.com', 'supporter');
```

## Use Cases

- Protect server-side game routes and APIs
- Verify tier access outside the browser
- Prevent client-side tier spoofing

## Docs

- Server SDK docs: https://sub.games/docs/sdk/server-sdk
- Browser SDK docs: https://sub.games/docs/sdk/browser-sdk