TypeScript SDK
Overview
Server-side specific functionality for Node.js environments
Introduction
The Node.js version of the SDK is used to interact with the Shelby network from a Node.js environment. The SDK provides a high level interface for interacting with the different components of the Shelby network: the coordination layer, the RPC layer, and the storage layer.
Installation
npm install @shelby-protocol/sdk @aptos-labs/ts-sdk
Usage
Access the Node.js version of the SDK by importing using the @shelby-protocol/sdk/node
entry point.
import { Network } from '@aptos-labs/ts-sdk'
import { ShelbyNodeClient } from "@shelby-protocol/sdk/node";
const client = new ShelbyNodeClient({
network: Network.SHELBYNET,
});
await client.upload({
signer,
blobData: fs.readFileSync("path/to/file.txt"),
blobName: "file.txt",
expirationMicros: (1000 * 60 * 60 * 24 * 30 + Date.now()) * 1000, // 30 days
});
Next Steps
Specifications
Reference documentation for the API and specifications
Uploading File Guide
Learn how to upload a file to the Shelby network