Package @raidboss/platform-sdk for web and React Native.

TypeScript / Web — @raidboss/platform-sdk

Install from Git (recommended for product apps)

npm install github:ivanbalandin/RaidBossPlatform#main:packages/platform-sdk
{
  "dependencies": {
    "@raidboss/platform-sdk": "github:ivanbalandin/RaidBossPlatform#main:packages/platform-sdk"
  }
}

Pin a release with a tag or commit SHA:

"@raidboss/platform-sdk": "github:ivanbalandin/RaidBossPlatform#sdk-ts-v0.1.0:packages/platform-sdk"

Private repo (SSH):

"@raidboss/platform-sdk": "git+ssh://git@github.com:ivanbalandin/RaidBossPlatform.git#main:packages/platform-sdk"

prepare builds dist/ via tsc when the full package is present (git/path install).
Docker monorepo deps stages (package.json only) skip the build.

Install from path (local monorepo)

{
  "dependencies": {
    "@raidboss/platform-sdk": "file:../RaidBossPlatform/packages/platform-sdk"
  }
}
import {
  RaidBossPlatformClient,
  createRaidBossClient,
  RaidBossPlatformError,
} from "@raidboss/platform-sdk";

Construct

const platform = new RaidBossPlatformClient({
  apiUrl: "YOUR_API_URL",
  applicationCode: "YOUR_APP_CODE",
  publicKey: "YOUR_PUBLIC_KEY",
  getAccessToken: async () => tokenOrNull,
  // applicationId?: string
  // fetch?: typeof fetch
});

Methods

MethodAuthPublic keyNotes
getPaywall(code?)norecommendedDefault paywall main
registerUser(...)yesCall after login/signup
registerDevice(...)yesStable installation_id
getMyEntitlements()yesSnapshot + codes
hasEntitlement(code)yesConvenience
hasAnyEntitlement(codes)yesConvenience
createPayment({ plan_price_id, return_url })yesrequiredPaid only
checkout(planPriceId, returnUrl)yesrequiredAlias helper
activateLicenseKey({ key, installation_id? })yesGrants plan rights
listDevices() / revokeDevice(id)yesDevice management
getConfig(...)noRemote config map
getFeatures(...)yesFeature flags
trackEvent / trackEventsyesAnalytics
createSupportTicketyesrequiredHelpdesk ticket
uploadSupportAttachmentyesrequiredScreenshot / video / log
listMySupportTickets / getSupportTicket / replyToSupportTicketyesMy tickets
isFreePrice(price) staticDetect free offer

Free price helper

if (RaidBossPlatformClient.isFreePrice(price)) {
  // do not createPayment — local free tier
}

Errors

Failed HTTP calls throw RaidBossPlatformError with status and body.

Free checkout attempt returns API error free_plan_offline.

Example (auth provider)

const platform = createRaidBossClient({
  apiUrl: "YOUR_API_URL",
  applicationCode: "YOUR_APP_CODE",
  publicKey: "YOUR_PUBLIC_KEY",
  getAccessToken: async () => session?.access_token ?? null,
});