@b3dotfun/bsmnt-launcher-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

B3 Launcher SDK

A TypeScript SDK for easy integration with websites and web games.

Installation

npm install @b3dotfun/bsmnt-launcher-sdk

Usage

Initialize the SDK

import B3LauncherSDK from '@b3dotfun/bsmnt-launcher-sdk';

const sdk = new B3WebSDK({
  releaseType: "embedded",
  debug: true, // Enable debug logging,
});

Calling APIs

Access all available APIs through methods on sdk.

// e.g. get channel status
const channelStatus = await sdk.getChannelStatus();

API

SDK Configuration

interface SDKConfig {
  releaseType: "embedded" | "external";
  debug?: boolean;
  overwriteJwt?: string;
}

Response Format

All API methods return a Promise with an ApiResponse object:

interface ApiResponse<T> {
  success: boolean;
  data?: T;
  error?: {
    code: string;
    message: string;
  };
}

Error Handling

const response = await sdk.setUserScore(100, "highscore");
if (!response.success) {
  console.error(`Error: ${response.error?.code} - ${response.error?.message}`);
}

Development

Building the SDK

npm run build

Running tests

npm test

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @b3dotfun/bsmnt-launcher-sdk

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

26.9 kB

Total Files

11

Last publish

Collaborators

  • npclabs
  • gionpclabs
  • alex-kaffetzakis
  • b3_david
  • anqt-dev
  • wojb3
  • mitchmyburgh
  • trung.npclabs
  • mikedutuandu