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

@omen.foundation/game-sdk

v1.0.14

Published

OmenX Game SDK for web applications - OAuth authentication and API integration

Downloads

1,394

Readme

@omen.foundation/game-sdk

OmenX Game SDK for web applications - OAuth authentication and API integration.

The SDK supports two modes:

  • Client Mode: OAuth authentication for frontend applications (browser/React)
  • Server Mode: API key authentication for Node.js backends

Installation

npm install @omen.foundation/game-sdk

Quick Start

Client Mode (OAuth Authentication)

For frontend applications that need user authentication:

import { OmenXGameSDK } from '@omen.foundation/game-sdk';

const sdk = new OmenXGameSDK({
  gameId: 'your-game-id',
  onAuth: (authData) => {
    console.log('Authenticated!', authData);
    // User is now authenticated
  },
  onAuthError: (error) => {
    console.error('Auth error:', error);
  },
});

// Initialize SDK
await sdk.init();

Server Mode (API Key Authentication)

For Node.js backends using developer API keys:

import { OmenXServerSDK } from '@omen.foundation/game-sdk';

const sdk = new OmenXServerSDK({
  apiKey: 'your-developer-api-key',
  apiBaseUrl: 'https://api.omen.foundation', // Optional
});

// Make API calls directly
const templates = await sdk.getNftTemplates('your-game-id');
const contract = await sdk.getNftContract('your-game-id');

OAuth Authentication

For standalone games (not embedded in iframes):

// Authenticate user via OAuth popup
await sdk.authenticate({
  redirectUri: 'https://yourgame.com/auth/callback',
  enablePKCE: true, // Recommended for security
});

Iframe Authentication

For games embedded in the OmenX frontend, authentication is automatic:

const sdk = new OmenXGameSDK({
  gameId: 'your-game-id',
  enableIframeAuth: true, // Default: true
  parentOrigin: 'https://omen.foundation', // Optional: for security
  onAuth: (authData) => {
    // Auth data received automatically from parent window
  },
});

await sdk.init();

Making API Calls (Client Mode)

// Make authenticated API calls using user's access token
const response = await sdk.apiCall('/v1/nfts/templates?gameId=your-game-id');
const data = await response.json();

Server Mode API Methods

The server SDK provides convenient methods for all API operations:

Health & Auth

// Health check
const health = await sdk.healthCheck();

// Get API key information
const info = await sdk.getApiKeyInfo();

Players

// Get wallet balances
const balances = await sdk.getPlayerBalances('0x...', '8453');

// Get wallet NFTs
const nfts = await sdk.getPlayerNfts('0x...', '8453', {
  contract: '0x...', // Optional
  cursor: '...',      // Optional
  limit: 20,          // Optional
});

Purchases

// Create a purchase
const purchase = await sdk.createPurchase({
  playerWallet: '0x...',
  skuId: 'sku-id',
  quantity: 1,
  idempotencyKey: 'unique-key', // Optional
});

NFTs

// Get NFT templates
const templates = await sdk.getNftTemplates('your-game-id');

// Get contract address
const contract = await sdk.getNftContract('your-game-id');

// Mint NFTs
const result = await sdk.mintNfts({
  templateId: 'template-id',
  recipientAddress: '0x...',
  quantity: 1,
});

// Batch mint
const batchResult = await sdk.batchMintNfts([
  { templateId: 'template-1', recipientAddress: '0x...', quantity: 1 },
  { templateId: 'template-2', recipientAddress: '0x...', quantity: 2 },
]);

// Update NFT metadata
await sdk.updateNftMetadata('token-id', {
  rarity: 'legendary',
  level: 10,
});

// Burn NFT
await sdk.burnNft('token-id');

// Batch burn
await sdk.batchBurnNfts(['token-1', 'token-2']);

// Pack opener
const packResult = await sdk.packOpener({
  dropTableId: 'drop-table-id',
  recipientAddress: '0x...',
});

// Generic API call
const response = await sdk.apiCall('/v1/custom-endpoint', {
  method: 'POST',
  body: { custom: 'data' },
});

Check Authentication Status

if (sdk.isAuthenticated()) {
  const authData = sdk.getAuthData();
  console.log('User:', authData.walletAddress);
}

Logout

await sdk.logout();

API Reference

See the full documentation for detailed API reference.

License

MIT