A JavaScript/TypeScript SDK for licensing user-generated content. Streamlines digital asset licensing with smart license templates, automated agreement creation, and seamless royalty management.

Installation

pnpm add @spaceport/sdk
# or
yarn add @spaceport/sdk
# or
npm install @spaceport/sdk

Initialization

The SDK supports the same networks as Cultura SDK: local, devnet, and testnet. You can initialize the client using either the network name or chain ID:

import { SpaceportSDK, Network, createChainConfig } from "@spaceport/sdk";
import { privateKeyToAccount } from "viem/accounts";

// Initialize SDK for local development (read-only)
const client = SpaceportSDK.create({
  chain: Network.LOCAL, // or use chain ID: 31337
});

// Initialize with wallet for local development
const account = privateKeyToAccount(`0x${process.env.YOUR_PRIVATE_KEY}`);
const client = SpaceportSDK.createWithAccount(account, {
  chain: Network.LOCAL,
});

// Initialize with API key for backend service authentication
const client = SpaceportSDK.create({
  chain: Network.DEVNET,
  apiKey: process.env.SDK_API_KEY, // Load from environment variable
});

// Initialize for Cultura Devnet with API key from environment
const account = privateKeyToAccount(`0x${process.env.YOUR_PRIVATE_KEY}`);
const client = SpaceportSDK.createWithAccount(account, {
  chain: Network.DEVNET, // or use chain ID: 26156
  apiKey: process.env.SDK_API_KEY, // Add API key for authenticated requests
});

Next Steps

For detailed examples and complete code, check out our workflow guides:

Core Workflows

Additional Guides