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

@masterunoco/casinowebengine-api

v0.1.2

Published

Typed front-end SDK for casino web-engine API

Readme

🕹️ Casino Web Engine API SDK

npm version npm downloads

A TypeScript front-end SDK for interacting with the casino web-engine API across casino front-end projects. It provides a unified interface for games, authentication, content, player preferences, website settings, and more — all with full type safety and automatic JWT handling.


✨ Features

  • 🤩 Typed API layer – all endpoints return strongly-typed responses.
  • 🔐 Built-in JWT auth – automatically attaches Authorization: JWT <token> to protected requests.
  • 🌐 Public + private endpoints – transparent auth handling (none, optional, required).
  • ⚙️ Configurable – base URL and timeout.
  • 🗾 Persistent storage – stores tokens and user data via localStorage helper.
  • 🧠 Framework-agnostic – works with any front-end (React, Vue, Next.js, etc.).
  • 🥷 Ready for npm – ships with ESM + CJS + .d.ts types.

📦 Installation

npm install @masterunoco/casinowebengine-api

Local development

If the SDK is cloned locally:

# In SDK directory
npm run build

# In your front-end project
npm install ../path-to/casinowebengine-api
# or
npm i file:../path-to/casinowebengine-api

🧰 Basic Setup

import { createGameSDK } from '@masterunoco/casinowebengine-api';

const sdk = createGameSDK({
  baseUrl: import.meta.env.VITE_GAMESERVICE_URL,
  timeoutMs: 15000,
});

🔑 Authentication

// Login (stores JWT in localStorage automatically)
await sdk.auth.login('player3', '123123', '<recaptcha-token>');

// Check if authenticated
if (sdk.auth.isAuthenticated()) {
  console.log('Logged in as', sdk.auth.getUser()?.username);
}

// Logout (clears token + user)
sdk.auth.clear();

🤩 Example Usage

🎮 Games

// Search games
const result = await sdk.games.searchGames({ category: 'slots', page: 1 });
console.log(result.totalCount, result.results[0].name);

// Get demo link
const demo = await sdk.games.getDemoLink(1234);
window.open(demo.gameLink, '_blank');

📄 Content Pages

const pages = await sdk.settings.listContentPages();
const about = await sdk.settings.getContentItem('about-us', 'en');
console.log(about.title);

⚙️ Preferences

const prefs = await sdk.settings.getPreferences();
await sdk.settings.updatePreferences({ displayMode: 'dark' });

💬 Website Settings

const footer = await sdk.settings.getWebSetting('en');
const providers = await sdk.settings.getWebSettingProviders('en');
const support = await sdk.settings.getSupportEmail('en');

🌍 Geolocation

const geo = await sdk.geolocation.getGeolocation();
console.log(geo);

🧱 Architecture

src/
├─ sdk.ts                # Core GameSDK class
├─ index.ts              # Barrel exports
├─ http/client.ts        # Fetch wrapper with timeout & authPolicy
├─ auth/jwtAuth.ts       # JWT lifecycle (login, store, clear)
├─ apis/
│  ├─ games.ts
│  ├─ settings.ts
│  ├─ geo.ts
│  └─ ...
├─ types/
│  ├─ auth.ts
│  ├─ gamesSearch.ts
│  ├─ settings.ts
│  └─ signup.ts
└─ localStorage.ts

🗾 Build Output

dist/
├─ index.js         (ESM)
├─ index.cjs        (CJS)
└─ index.d.ts       (Type declarations)

🗾 License

MIT © 2025