Skip to content
Docs

Platforms

Platform support

Which SDK features work on Node.js, browsers, extensions, and React Native, and which keystore backend to use.

Overview

@gray3/core, @gray3/client, and @gray3/keystore run on Node.js, in browsers and Chrome extensions, and in React Native and Expo apps. Keys are generated, stored, and used on the device on every platform. @gray3/cloud is different: it is server-side only and runs on Node.js 20 or later, Deno, Bun, and edge runtimes.

Each package ships separate builds selected through package exports: the react-native condition for Metro, browser and worker for web bundlers, and node for Node.js. Metro, Vite, webpack 5, Next.js, and esbuild pick the right build automatically.

Choose your platform

Architecture

Browser, extension, and mobile apps never hold your project secret. They keep keys on the device and call your backend; your backend calls the Gray3 Cloud API.

The device keeps keys and signs; your backend holds the project secret and calls the Gray3 Cloud API.
One send, step by step.

Support by chain family

"Addresses" covers derivation, key import, and address validation. "Signing" covers signPreparedTransaction and signMessage where the family has them. "Wallet" covers Monero wallet sync and transfers.

FamilyNode.jsBrowser and extensionReact Native (Hermes)
EVM, Tron, Solana, Sui, Aptos, Movement, NEAR, Stellar, Algorand, Cosmos, Hedera, Filecoin, VeChain, Stacks, XRPL, Cardano, UTXOYesYesYes
Polkadot, BittensorYesYes (WebAssembly; extensions need 'wasm-unsafe-eval')Yes (asm.js; slower first start)
Gram (TON)YesYes; signing needs a global BufferAddresses yes; signing after configureTon()
KaspaYesAddresses yes; signing noAddresses yes; signing no
MoneroKeys, wallet sync, and transfersKeys and addresses; wallet sync after configureMonero()Keys and addresses; no wallet sync

Keystore backend per platform

BackendNode.jsBrowser and extensionReact Native and ExpoInstall
sqlite: { path }YesNoNobetter-sqlite3
sqlite: { web: { name, wasmUrl } }YesYesNo (needs WebAssembly)sql.js
sqlite: { expo }NoNoYesexpo-sqlite
sqlite: { driver } or a KV adapterYesYesYesYour driver or store

The SQLite drivers are optional peer dependencies of @gray3/keystore, so install the one your platform uses. Asking for a backend the current build cannot run throws unsupported_capability.

Check support at runtime

ts
import {
  detectPlatform,
  currentPlatform,
  getPlatformSupport,
  chainSupportsPlatform,
} from "@gray3/client";

detectPlatform();   // "node" | "browser" | "react-native", from the environment
currentPlatform();  // the platform of the build your bundler selected

getPlatformSupport("browser").kaspa;
// { derive: true, sign: false, wallet: true, requires: [], note: "…signing is Node-only." }
// Omit the argument to get the table for the current platform.

chainSupportsPlatform("kaspa", "react-native", "sign"); // false
chainSupportsPlatform("polkadot", "browser");           // true (capability defaults to "derive")

Hide or disable features that return false before the user reaches them. Unsupported combinations throw GrayError with code unsupported_capability.

Required globals

Every platform needs crypto.getRandomValues, TextEncoder, and TextDecoder. GrayClient.create checks them and throws unsupported_capability naming the missing one. A global Buffer is needed only for Gram (TON) signing. Node.js and modern browsers already provide everything else; React Native needs react-native-get-random-values.

@gray3/core

@gray3/core is pure TypeScript with no Node.js built-ins and no runtime dependencies. It runs unchanged on every platform above with no polyfills or bundler configuration. @gray3/client and @gray3/keystore depend on it and re-export the common helpers, so install it directly only if you use it on its own (for example, in a backend that only needs the chain catalog).