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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@quantcdn/quant-client

v4.4.0

Published

OpenAPI client for @quantcdn/quant-client

Readme

Quant TypeScript Client

A comprehensive TypeScript client for the Quant API, providing access to all Quant Cloud services including applications, environments, containers, cron jobs, and more.

Installation

npm install quant-ts-client

Usage

import { EnvironmentsApi, Configuration } from 'quant-ts-client';

// Create a configuration with your API key
const config = new Configuration({
  apiKey: 'YOUR_API_KEY',
  basePath: 'https://dashboard.quantcdn.io'
});

// Initialize an API instance
const environmentsApi = new EnvironmentsApi(config.basePath);
environmentsApi.setDefaultAuthentication({ 
  applyToRequest: (requestOptions) => {
    if (requestOptions && requestOptions.headers) {
      requestOptions.headers["Authorization"] = `Bearer ${config.apiKey}`;
    }
  }
});

// Example: List all environments for an application
environmentsApi.listEnvironments('your-org-id', 'your-app-id')
  .then(response => {
    console.log(response.body);
  })
  .catch(error => {
    console.error(error);
  });

Available APIs

The client provides access to the following API endpoints:

Core Services

  • ApplicationsApi - Manage applications
  • EnvironmentsApi - Manage environments
  • ContainersApi - Manage containers
  • CommandsApi - Execute commands
  • ComposeApi - Docker Compose and container definitions

Scheduling & Automation

  • CronApi - Manage cron jobs
  • CrawlersApi - Web crawler management
  • CrawlerSchedulesApi - Crawler scheduling

Data & Storage

  • VariablesApi - Environment variables
  • VolumesApi - Volume management
  • KVApi - Key-value storage
  • BackupManagementApi - Backup operations

Security & Access

  • SSHAccessApi - SSH access management
  • OrganizationsApi - Organization management
  • ProjectsApi - Project management

Rules & Traffic Management

  • RulesApi - Unified rules management (auth, redirects, proxies, headers, etc.)

Infrastructure & Performance

  • DomainsApi - Domain management
  • HeadersApi - Custom headers
  • PurgeApi - Cache purging
  • ScalingPolicyApi - Auto-scaling policies

AI & Advanced Features

  • AIServicesApi - AI services integration

Examples

Working with Applications

import { ApplicationsApi } from 'quant-ts-client';

const appsApi = new ApplicationsApi(config.basePath);
appsApi.setDefaultAuthentication(auth);

// List all applications
const apps = await appsApi.listApplications('your-org-id');

// Create a new application
const newApp = await appsApi.createApplication('your-org-id', {
  name: 'my-app',
  description: 'My new application'
});

Managing Environments

import { EnvironmentsApi } from 'quant-ts-client';

const envsApi = new EnvironmentsApi(config.basePath);
envsApi.setDefaultAuthentication(auth);

// Create an environment
const env = await envsApi.createEnvironment('org-id', 'app-id', {
  name: 'production'
});

// Get environment logs
const logs = await envsApi.getEnvironmentLogs('org-id', 'app-id', 'env-id');

Working with Cron Jobs

import { CronApi } from 'quant-ts-client';

const cronApi = new CronApi(config.basePath);
cronApi.setDefaultAuthentication(auth);

// Create a cron job
const cronJob = await cronApi.createCronJob('org-id', 'app-id', 'env-id', {
  name: 'daily-backup',
  schedule: '0 2 * * *',
  command: 'backup-database'
});

Development

Prerequisites

  • Node.js 16+
  • TypeScript 4.9+

Building the package

npm install
npm run build

Testing locally

To test the package locally in another project:

# In the SDK directory
npm run build
npm link

# In your project directory
npm link quant-ts-client

Publishing the package

npm publish

TypeScript Support

This package includes full TypeScript definitions and is built with TypeScript 4.9+. All API methods, request/response types, and configuration options are fully typed.

Error Handling

The client includes comprehensive error handling with typed error responses:

try {
  const response = await environmentsApi.getEnvironment('org', 'app', 'env');
} catch (error) {
  if (error instanceof HttpError) {
    console.error(`HTTP ${error.statusCode}: ${error.message}`);
  } else {
    console.error('Unexpected error:', error);
  }
}

License

MIT