npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aurabx/uploader-client

v1.0.0

Published

Aura Uploader API client for Node.js - server-side library for auth and manage endpoints

Readme

@aurabx/uploader-client

A TypeScript/Node.js client library for the Aura Uploader API. This library provides the same API as the .NET AuraUploaderClient.

This library is only required by (and can only be implemented by) Aurabox integration partners. Contact Aurabox for more information.

Requirements

  • Node.js 18.0.0 or later
  • TypeScript 5.x (for development)

Installation

npm install @aurabx/uploader-client
# or
pnpm add @aurabx/uploader-client

Quick Start

import { AuraUploaderClient } from "@aurabx/uploader-client";

const client = new AuraUploaderClient({
  baseUrl: "https://aura.example.com",
  appId: "your-app-id",
  appSecret: "your-app-secret",
  apiKey: "your-api-key",
});

// Authenticate (automatically called by other methods)
const token = await client.ensureAuthenticated();

// Submit an upload for processing
const submitResult = await client.submit({
  upload_id: "your-upload-id",
  metadata: {
    patient_id: "12345",
    study_type: "CT",
  },
});

// Withdraw an upload
const withdrawResult = await client.withdraw({
  upload_id: "your-upload-id",
  reason: "Duplicate upload",
});

API Reference

AuraUploaderClient

The main client class for interacting with the Aura Uploader API.

Constructor

new AuraUploaderClient(options: AuraClientOptions)

Options: | Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | baseUrl | string | Yes | - | Base URL for the Aura API | | appId | string | Yes | - | Application public ID | | appSecret | string | Yes | - | Application secret key | | apiKey | string | Yes | - | API key for additional authentication | | tokenTtl | number | No | 3600 | Token time-to-live in seconds | | defaultScopes | string[] | No | ["upload:init", "upload:manage", "integration:read"] | Default scopes for token exchange |

Methods

exchangeToken(request?: TokenExchangeRequest): Promise<TokenExchangeResponse>

Exchange HMAC credentials for a bearer token.

const response = await client.exchangeToken({
  ttl: 3600,
  scopes: ["upload:init", "upload:manage"],
});
console.log(response.access_token);
ensureAuthenticated(): Promise<string>

Ensures a valid access token is available, refreshing if necessary. Returns the access token.

const token = await client.ensureAuthenticated();
submit(request: SubmitRequest): Promise<SubmitResponse>

Submit an upload for processing.

const result = await client.submit({
  upload_id: "your-upload-id",
  metadata: { patient_id: "12345" },
});
withdraw(request: WithdrawRequest): Promise<WithdrawResponse>

Withdraw a previously submitted upload.

const result = await client.withdraw({
  upload_id: "your-upload-id",
  reason: "Duplicate upload",
});

Low-Level HMAC Signing

For advanced use cases, you can use the signRequest function directly:

import { signRequest, type HttpRequest } from "@aurabx/uploader-client";

const request: HttpRequest = {
  method: "POST",
  baseUrl: "https://aura.example.com",
  url: "/api/auth/exchange",
  headers: {
    Host: "aura.example.com",
    "Content-Type": "application/json",
    "X-Api-Key": "your-api-key",
  },
  body: { ttl: 3600 },
};

signRequest("your-app-id", "your-app-secret", request);
// request.headers now contains Authorization, X-Aura-Timestamp, X-Aura-Nonce

Error Handling

The client throws AuraApiError for API errors:

import { AuraApiError } from "@aurabx/uploader-client";

try {
  await client.submit({ upload_id: "invalid" });
} catch (error) {
  if (error instanceof AuraApiError) {
    console.error("Status:", error.statusCode);
    console.error("Response:", error.responseContent);
  }
}

Request Cancellation

All methods accept an optional AbortSignal for request cancellation:

const controller = new AbortController();

// Cancel after 5 seconds
setTimeout(() => controller.abort(), 5000);

try {
  await client.submit({ upload_id: "..." }, controller.signal);
} catch (error) {
  if (error.name === "AbortError") {
    console.log("Request cancelled");
  }
}

Development

# Install dependencies
pnpm install

# Run tests
pnpm test

# Type check
pnpm typecheck

# Build
pnpm build

# Run example
pnpm example

API Endpoints

This client covers the following API endpoints:

| Endpoint | Method | Description | |----------|--------|-------------| | /api/auth/exchange | POST | Exchange HMAC credentials for bearer token | | /api/uploader/manage/submit | POST | Submit an upload for processing | | /api/uploader/manage/withdraw | POST | Withdraw a previously submitted upload |

Compatibility

This library is designed to be API-compatible with the .NET AuraUploaderClient. The HMAC signing algorithm produces identical signatures for the same inputs.

License

UNLICENSED