Solana Kit

Overview

Server-side Solana Kit for Node.js environments

Node.js API

The Node.js entry point provides server-side functionality for integrating Solana applications with the Shelby Protocol. It's designed for backend services, scripts, and CLI applications where you have direct access to Solana keypairs.

Installation

npm install @shelby-protocol/solana-kit @solana/web3.js

Usage

Import from the @shelby-protocol/solana-kit/node entry point:

import { Shelby, Network } from "@shelby-protocol/solana-kit/node";
import { Connection, Keypair } from "@solana/web3.js";

// Create a Solana connection
const connection = new Connection("https://api.devnet.solana.com");

// Initialize the Shelby client
const shelbyClient = new Shelby({
  network: Network.SHELBYNET,
  connection,
  apiKey: "AG-***",
});

// Create a storage account from a Solana keypair
const solanaKeypair = Keypair.generate();
const storageAccount = shelbyClient.createStorageAccount(
  solanaKeypair,
  "my-app.com"
);

// Upload data
await shelbyClient.upload({
  blobData: new Uint8Array([1, 2, 3]),
  signer: storageAccount,
  blobName: "example.txt",
  expirationMicros: Date.now() * 1000 + 86400000000,
});

When to Use Node.js

Use the Node.js entry point when you:

  • Have direct access to Solana keypairs (e.g., from environment variables or key files)
  • Building backend services or APIs
  • Running scripts or CLI tools
  • Processing data server-side before storing on Shelby

For browser applications with wallet connections, use the React entry point instead.

Exports

The @shelby-protocol/solana-kit/node entry point exports:

ExportDescription
ShelbyMain client class for Solana-Shelby integration
ShelbyStorageAccountStorage account class (also via createStorageAccount)
NetworkNetwork configuration constants
Re-exports from SDKAll exports from @shelby-protocol/sdk/node

Next Steps