Skip to main content
The @alphscan/sdk package is the core JavaScript/TypeScript client for the Alphscan API. It provides a typed, promise-based interface for all public and authenticated endpoints.

Repository & package

Repositories are under the AlphScan organization. Packages are private on npm for now and will be public at release.

Features

  • Typed APIs for tokens, transactions, plans, keys, and payments
  • Settings from env or code — use ALPHSCAN_API_URL, ALPHSCAN_API_KEY, etc., or pass options to alphscan()
  • Raw request — call any API path with client.request(method, path, body?)
  • ESM — ships as ES modules with TypeScript types

Package

npm install @alphscan/sdk
# or
pnpm add @alphscan/sdk

Quick example

import { alphscan } from "@alphscan/sdk";

const client = alphscan({
  apiUrl: "https://api.alphscan.io",
  apiKey: "your-api-key", // optional for public endpoints
});

// List tokens (public)
const { tokens, total } = await client.token.list({ page: 1, pageSize: 20 });

// List plans (public)
const { plans } = await client.plan.list();

// Normalized events for a transaction (requires apiKey for user-level access)
const events = await client.tx("ba076401862824ef18b7fe436fcf99de9dea4066e91671473205df2ee34619d3").normalizedEvents();

Client surface

APIDescriptionAuth
client.tokenList tokens (GET /token/all)Public
client.planList API plans (GET /system/plans)Public
client.tx(id)Transaction-scoped API (normalized events)User
client.keysList/create API keysAdmin
client.paymentPayment flow (request, verify, pending, history)Admin
client.request(method, path, body?)Raw request for any pathDepends on path

Next steps

Installation

Install and configure the SDK.

Client & settings

Create the client and configure API URL, key, and env.

Token API

List tokens with pagination.

Transaction API

Fetch normalized events for a transaction.

System API

Plans, keys, and payments.

Raw request

Call any endpoint with request().