@tusky-io/ts-sdk) gives you full programmatic access to the Tusky platform — create environments, upload files, manage members, and configure aggregators from any JavaScript or TypeScript application.
Prerequisites
- Node.js 18 or later
- A Tusky account with an API key or a Sui wallet
Installation
Import the SDK
The SDK ships with separate entry points for server and browser environments.- Node.js
- Browser
The browser entry point excludes Node-specific dependencies (such as
fs and path) so your bundler does not pull in unnecessary polyfills.Initialize the Client
The fastest way to get started is with an API key. You can generate one from the Tusky dashboard.Quick Example
The following snippet creates an environment and uploads a file in just a few lines:Generate an API key
Open the Tusky dashboard, navigate to Settings → API Keys, and create a new key.
Configuration Options
TheTusky constructor accepts an options object:
| Option | Type | Description |
|---|---|---|
apiKey | string | API key for server-side authentication. |
wallet | WalletAdapter | Keypair | Sui wallet adapter (browser) or keypair (server). |
baseUrl | string | Override the API base URL (defaults to https://api.tusky.io). |
aggregatorUrl | string | Custom aggregator URL for downloads. Use any Walrus aggregator — Tusky’s, a public one, or your own. Enables decryption without Tusky. |