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

@dployr-io/dployr-sdk

v2.1.0

Published

TypeScript SDK for dployr

Readme

@dployr-io/dployr-sdk

TypeScript SDK for interacting with dployr.

Installation

npm install @dployr-io/dployr-sdk
# or
pnpm add @dployr-io/dployr-sdk
# or
yarn add @dployr-io/dployr-sdk

Usage

import { createDployrClient } from '@dployr-io/dployr-sdk';

// Connect to your Dployr instance
const { client, tokenManager } = createDployrClient('https://your-dployr-instance.com');

// Obtain a JWT access token from your dployr base server
// (see https://docs.dployr.dev/auth for details on how to authenticate with base)
const accessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'; // issued by base

// Set the token so all requests to the instance are authenticated
tokenManager.setAccessToken(accessToken);

// Now you can make authenticated API calls to the instance
const deploymentsResponse = await client.deployments.get();
const servicesResponse = await client.services.get();

const deployments = deploymentsResponse?.deployments ?? [];
const services = servicesResponse?.services ?? [];

Authentication

The SDK uses JWT-based authentication with tokens issued by base:

  • Access tokens are short-lived (~10 minutes) and used for API requests to instances
  • Refresh tokens are long-lived (24+ hours) and used to obtain new access tokens from base

Use the TokenManager to store and manage the tokens you receive from base. The SDK does not auto-refresh tokens; if an access token expires you should:

  1. Call your base server's refresh endpoint to get a new access token.
  2. Update the SDK's token manager, e.g. tokenManager.setAccessToken(newAccessToken).
  3. Retry the failed request if needed.

For the full authentication flow and examples of obtaining tokens from base, see https://docs.dployr.dev/auth.

Client overview

createDployrClient returns an object with:

  • client.deployments – list and create deployments.
  • client.services – list services and access a single service by ID.
  • client.logs – access log streaming.
  • client.proxy – inspect and change proxy routes and status.
  • client.system – read system health and info.

Each property exposes request builders generated from the OpenAPI description. Most methods follow the pattern get(), post(body), delete(), or patch(body). List endpoints return typed DTOs such as DeploymentsGetResponse and ServicesGetResponse that contain both the items and a total count.

Common operations

List deployments:

const deploymentsResponse = await client.deployments.get({
  queryParameters: { limit: 20, offset: 0 },
});

const deployments = deploymentsResponse?.deployments ?? [];

List services:

const servicesResponse = await client.services.get({
  queryParameters: { limit: 20, offset: 0 },
});

const services = servicesResponse?.services ?? [];

Get a single service:

const service = await client.services.byServiceId('service-id').get();

Stream logs for a service or deployment (Server-Sent Events):

const response = await client.logs.stream.get({
  queryParameters: { token: accessToken, id: 'service-or-deployment-id' },
});
// Handle the text/event-stream response using your HTTP stack.

Check system status:

const status = await client.system.status.get();

Restart proxy:

const result = await client.proxy.restart.post();

Documentation

For full API reference and guides for the TypeScript SDK, visit https://sdk.dployr.dev/typescript.