Package Exports
- @axonsdk/sdk
- @axonsdk/sdk/runtime/global
Readme
@axonsdk/sdk
Provider-abstracted SDK for deploying and calling confidential edge applications across DePIN compute networks.
Overview
@axonsdk/sdk is the core library for the Axon platform. It gives you a single, unified interface to deploy code and exchange messages with processors running on any supported DePIN network — without changing your application logic when you switch providers.
Supported providers: io.net · Acurast · Akash Network · Fluence · Koii
Installation
npm install @axonsdk/sdkRequires Node.js ≥ 20.
Quick start
import { AxonClient } from '@axonsdk/sdk';
const client = new AxonClient({
provider: 'akash', // 'ionet' | 'acurast' | 'fluence' | 'koii' | 'akash'
secretKey: process.env.AXON_SECRET_KEY,
});
await client.connect();
const deployment = await client.deploy({
runtime: 'nodejs',
code: './dist/index.js',
schedule: { type: 'on-demand', durationMs: 86_400_000 },
replicas: 1,
});
await client.send(deployment.processorIds[0], { prompt: 'Hello' });
client.onMessage((msg) => console.log(msg.payload));
client.disconnect();Multi-provider Router
Route across multiple providers simultaneously with automatic failover, circuit breaking, and health-based scoring:
import { AxonRouter } from '@axonsdk/sdk';
const router = new AxonRouter({
providers: ['akash', 'acurast'],
secretKey: process.env.AXON_SECRET_KEY,
strategy: 'latency', // 'balanced' | 'latency' | 'availability' | 'cost' | 'round-robin'
processorStrategy: 'fastest', // 'round-robin' | 'fastest' | 'random' | 'first'
failureThreshold: 3,
recoveryTimeoutMs: 30_000,
maxRetries: 2,
});
await router.connect();
await router.deploy(config); // deploys to ALL providers in parallel
await router.send({ prompt: 'Hello' }); // auto-picks the best provider
router.health().forEach((h) => {
console.log(h.provider, h.latencyMs, h.circuitState, h.score);
});Routing strategies
| Strategy | Best for |
|---|---|
balanced |
General purpose — equal weight on availability, latency, cost |
latency |
Interactive workloads — always picks the fastest provider |
availability |
High uptime — prefers the most reliable provider |
cost |
Batch jobs — routes to the cheapest option |
round-robin |
Even load distribution |
Mobile (iOS & Android)
Use @axonsdk/mobile for React Native / Expo apps.
CLI
npm install -g @axonsdk/cli
axon init
axon deployDocumentation
Full documentation at axon.dev and the GitHub repository.
License
Apache-2.0 © Axon
Note: The routing engine (
AxonRouterinternals) is proprietary and confidential. See individual file headers for details.