Installation
Requirements
- Node.js 22 or newer
- JavaScript with native ESM
- npm installed on your development machine
Run the SDK on your server. Your browser or mobile application calls your backend. The public provider example below needs no API key; workspace commands require a scoped key and authorized access.
Runnable starter
The starter includes the SDK archive, a Node.js server, a browser application, JavaScript and TypeScript examples, and build configuration.
Download starter v0.1.1unzip aggregator-network-sdk-starter-0.1.1.zipcd aggregator-network-sdk-starter-0.1.1cp .env.example .envnpm installnpm run devOpen http://127.0.0.1:3000 on the machine running the starter. Provider cards load public data without a key. The commands use a Unix shell; you may instead extract the archive and copy the environment file with your file manager.
npm run providers:jsThese alternative commands run the JavaScript provider example without the browser. Configure the key and currency in .env for workspace catalogue access, then restart the local server. For an existing project, follow the manual installation below.
Download and install
Create an empty project folder and save this package.json there. The selected JavaScript configuration includes the correct verification command.
{ "name": "aggregator-sdk-example", "private": true, "type": "module", "scripts": { "verify": "node verify.mjs" }}Save the archive in that project folder. Open a terminal in the folder and install the package using npm.
npm install ./aggregator-network-sdk-0.1.1.tgzVerify installation
Save the following example as verify.mjs. The .mjs extension enables native ESM; no compiler is required.
import { AggregatorClient } from '@aggregator-network/sdk'; const client = new AggregatorClient();const directory = await client.listProviders();console.log('Public providers:', directory.providers.length);npm run verifyThe script prints the public provider count. Your workspace catalogue may differ. Continue with configuration for authenticated commands.
TypeScript setup
Prefer TypeScript?
Your current JavaScript setup runs directly with Node.js. Switch to TypeScript to view the matching compiler dependencies, typed example, build script and tsconfig.
Updating the package
Download the desired version and replace the local archive dependency using your selected package manager. Keep the archive or an internal package mirror available to your deployment system. Commit the resulting manifest and lockfile, and validate your integration before releasing it.
npm install ./aggregator-network-sdk-0.1.1.tgzTroubleshooting
| Problem | Resolution |
|---|---|
| Archive not found | Use the directory containing the downloaded archive, or its relative file path. |
| Module not found | Install the archive into the project that executes your script. |
| Import syntax error | Use the provided ESM package configuration and matching source filename. |
| TypeScript file not runnable | Run npm run build, then execute the compiled file in dist. |
| Browser import rejected | Move the SDK import to your backend. Keys remain server-side. |
| Directory request fails | Check Node.js version, server egress and TLS connectivity, then inspect the typed error. |