Skip to main content

Installation

Requirements

  • Node.js 18 or higher (uses native fetch)
  • TypeScript 5.4+ (recommended, not required for JavaScript usage)

Install from npm

The simplest way to install the SDK:

npm install ashr-labs

Or with other package managers:

# Yarn
yarn add ashr-labs

# pnpm
pnpm add ashr-labs

Install from Source

Clone the repository and build:

git clone https://github.com/ashr-labs/ashr-labs.git
cd ashr-labs/sdk-ts
npm install
npm run build

Install with Development Dependencies

If you want to contribute or run tests:

git clone https://github.com/ashr-labs/ashr-labs.git
cd ashr-labs/sdk-ts
npm install

This installs additional packages:

  • vitest — Test runner
  • typescript — TypeScript compiler
  • @types/node — Node.js type definitions

Verify Installation

After installation, verify it works:

import { AshrLabsClient } from "ashr-labs";

const client = new AshrLabsClient("tp_your_api_key_here");
console.log(client.toString());

TypeScript Configuration

The SDK ships with full type definitions. For best results, ensure your tsconfig.json includes:

{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "bundler",
"target": "ES2022",
"strict": true
}
}

The SDK is published as ESM ("type": "module" in package.json). If your project uses CommonJS, you may need a bundler or dynamic import().

Upgrading

To upgrade to the latest version:

npm install ashr-labs@latest