A TypeScript SDK for easy integration with websites and web games.
npm install @b3dotfun/bsmnt-launcher-sdk
import B3LauncherSDK from '@b3dotfun/bsmnt-launcher-sdk';
const sdk = new B3WebSDK({
releaseType: "embedded",
debug: true, // Enable debug logging,
});
Access all available APIs through methods on sdk
.
// e.g. get channel status
const channelStatus = await sdk.getChannelStatus();
interface SDKConfig {
releaseType: "embedded" | "external";
debug?: boolean;
overwriteJwt?: string;
}
All API methods return a Promise with an ApiResponse object:
interface ApiResponse<T> {
success: boolean;
data?: T;
error?: {
code: string;
message: string;
};
}
const response = await sdk.setUserScore(100, "highscore");
if (!response.success) {
console.error(`Error: ${response.error?.code} - ${response.error?.message}`);
}
npm run build
npm test
MIT