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
| Method | Auth | Public key | Notes |
|---|---|---|---|
getPaywall(code?) | no | recommended | Default paywall main |
registerUser({ platform, display_name, avatar_url, timezone, acquisition_source }) | yes | — | After login/signup; does not upgrade legal versions |
getMyConsents / acceptConsents | yes | — | Check + explicit accept of new versions |
updateUserProfile({ display_name, avatar_url, timezone }) | yes | — | After name/avatar change in your app |
registerDevice(...) | yes | — | Stable UUID installation_id → user_devices / “Devices active” |
getMyEntitlements() | yes | — | Snapshot + codes |
hasEntitlement(code) | yes | — | Convenience |
hasAnyEntitlement(codes) | yes | — | Convenience |
createPayment({ plan_price_id, return_url }) | yes | required | Paid only |
syncPayment(payment_id) | yes | — | After YooKassa return |
checkout(planPriceId, returnUrl) | yes | required | Alias helper |
activateLicenseKey({ key, installation_id? }) | yes | — | Grants plan rights |
listDevices() / revokeDevice(id) | yes | — | Device management |
getConfig(...) | no | — | Remote config map |
getFeatures(...) | yes | — | Feature flags |
getApplicationBranding() | no | required | App icon + website |
getBanner / listBanners | no | required | App HTML banners |
getSiteBanner / listSiteBanners | no | required | CMS site banners |
trackEvent / trackEvents | yes | — | Analytics; with installation_id+platform also heartbeats device |
createSupportTicket | yes | required | Helpdesk ticket |
uploadSupportAttachment | yes | required | Screenshot / video / log |
listMySupportTickets / getSupportTicket / replyToSupportTicket | yes | — | My tickets |
getCmsSite / listCmsBlogPosts / … | no | required | CMS Site on landing |
isFreePrice(price) static | — | — | Detect 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,
});