Browser support
Supported browsers and how to detect unsupported ones before connecting.
The SDK runs on desktop Chromium-based browsers (Chrome, Edge, Opera, Brave, …) and desktop Firefox only.
Safari (desktop and iOS) and all mobile browsers are unsupported. create() throws
BROWSER_NOT_SUPPORTED synchronously on them. Detect ahead of time and prompt the user to switch
to a supported desktop browser before they try to start a call.
The check is an allowlist, so it default-denies: anything it does not recognise as a desktop
Chromium-based browser or Firefox is rejected with reason: 'unknown' — including environments that are not
a browser at all, such as server-side rendering and a jsdom test runner. Call create() on the
client only, after mount, or it will throw during SSR/hydration.
Detect before you connect
The SDK exports detectBrowserSupport so you can check the environment and show a friendly message
before calling create():
import { detectBrowserSupport } from '@useathos/sdk';
const support = detectBrowserSupport(navigator.userAgent);
// support => { supported: boolean; reason?: 'safari' | 'mobile' | 'unknown' }
if (!support.supported) {
showUnsupportedBrowserMessage(support.reason);
// e.g. "Practice calls require desktop Chrome, Edge, or Firefox."
} else {
startPracticeButton.disabled = false;
}Handling the thrown error
If you call create() on an unsupported browser anyway, it throws synchronously — wrap it:
import { AthosRoleplay, AthosRoleplayError } from '@useathos/sdk';
try {
const session = AthosRoleplay.create({ token, drillKey });
// …
} catch (e) {
// A caught value is `unknown` under strict TypeScript — narrow before reading `.code`.
if (e instanceof AthosRoleplayError && e.code === 'BROWSER_NOT_SUPPORTED') {
showUnsupportedBrowserMessage();
} else {
throw e;
}
}