Skip to main content
@trustlink/tsn-sdk is the application-facing TypeScript package for TSN. It provides service selection, TIP/TIN identity helpers, signed payment authorization builders, intent submission, wallet transaction utilities, and recovery functions. The SDK prepares and submits authorized requests; the TSN Node verifies work, the Receiver coordinates it, and a permissioned Cranker submits the authorized transaction. The package is currently maintained in the TSN Protocol workspace and is not published to the public npm registry. Use the repository build before importing it into an application:
Build the workspace SDK

First connection

Pass the endpoints selected by your application. The SDK checks configured local endpoints before configured live endpoints for Node, Receiver, and Solana RPC, then reports which endpoint was selected.
Check service availability
Use the SDK’s TIN V1 resolver in a trusted application environment when the application is authorized to access the TIP registry lookup secret. Keep TINS_LOOKUP_SECRET on the server; do not bundle it into browser code. The Node independently validates the TIN registry and route during payment verification.

Build an integration

The guides introduce one SDK task at a time, with the relevant inputs and code before the protocol details:

Quickstart

Connect services, resolve a TIN, sign an authorization, submit a request, and follow its status.

Network status

Configure local-first service discovery and check readiness before requesting a wallet signature.

TIN V1 identity

Create private identity envelopes and recover a TIN through its owner-indexed record.

Payment lifecycle

Follow authorization, Receiver acceptance, Node verification, Cranker execution, and confirmation.

SDK reference

The reference pages document the public package exports and their source-backed behavior. Start with TSN SDK for application functions, TIN V1 SDK for identity creation and recovery, and Cranker SDK for operator setup. For protocol concepts and deployed status, see Protocol Architecture and Current Technology. The guides distinguish source behavior from deployed capabilities.