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
- Expo (SDK 51 or later)
- Bare React Native (0.74 or later, Hermes)
- Next.js (client components plus route handlers)
- React with Vite
- Node.js (scripts, servers, backends)
- Chrome extensions (Manifest V3)
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.
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.
| Family | Node.js | Browser and extension | React Native (Hermes) |
|---|---|---|---|
| EVM, Tron, Solana, Sui, Aptos, Movement, NEAR, Stellar, Algorand, Cosmos, Hedera, Filecoin, VeChain, Stacks, XRPL, Cardano, UTXO | Yes | Yes | Yes |
| Polkadot, Bittensor | Yes | Yes (WebAssembly; extensions need 'wasm-unsafe-eval') | Yes (asm.js; slower first start) |
| Gram (TON) | Yes | Yes; signing needs a global Buffer | Addresses yes; signing after configureTon() |
| Kaspa | Yes | Addresses yes; signing no | Addresses yes; signing no |
| Monero | Keys, wallet sync, and transfers | Keys and addresses; wallet sync after configureMonero() | Keys and addresses; no wallet sync |
Keystore backend per platform
| Backend | Node.js | Browser and extension | React Native and Expo | Install |
|---|---|---|---|---|
| sqlite: { path } | Yes | No | No | better-sqlite3 |
| sqlite: { web: { name, wasmUrl } } | Yes | Yes | No (needs WebAssembly) | sql.js |
| sqlite: { expo } | No | No | Yes | expo-sqlite |
| sqlite: { driver } or a KV adapter | Yes | Yes | Yes | Your 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
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).