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

@zdql/echo-typescript-sdk

v1.0.21

Published

TypeScript SDK for Echo platform

Downloads

5

Readme

Echo TypeScript SDK

The official TypeScript SDK for the Echo platform, providing easy access to Echo APIs and a command-line interface for managing your Echo applications.

Installation

pnpm install @echo/typescript-sdk

CLI Usage

The SDK includes a CLI tool for managing your Echo account from the command line.

Authentication

First, authenticate with your Echo account:

npx echo-cli login

This will:

  1. Open your browser to the Echo authentication page
  2. Guide you through creating an API key
  3. Securely store the API key locally

Available Commands

# Show authentication status
npx echo-cli whoami

# Get account balance
npx echo-cli balance

# List your Echo apps
npx echo-cli apps

# Logout (remove stored credentials)
npx echo-cli logout

Programmatic Usage

import { EchoClient } from '@echo/typescript-sdk';

// Initialize with API key
const client = new EchoClient({
  apiKey: 'echo_your_api_key_here',
});

// Or use stored credentials from CLI
const client = new EchoClient();

// Get account balance
const balance = await client.getBalance();
console.log(`Balance: $${balance.balance}`);

// List your Echo apps
const apps = await client.listEchoApps();
console.log('Your apps:', apps);

// Get a specific app
const app = await client.getEchoApp('app-id');

// Create a payment link
const paymentResponse = await client.createPaymentLink({
  amount: 10.0, // $10.00
  description: 'Credits for my account',
});
console.log('Payment URL:', paymentResponse.paymentLink.url);

// Get app URL
const appUrl = client.getAppUrl('app-id');
console.log('App URL:', appUrl);

Configuration

The SDK can be configured via environment variables or constructor options:

const client = new EchoClient({
  baseUrl: 'https://your-echo-instance.com', // Default: http://localhost:3000
  apiKey: 'your-api-key', // Optional if using stored credentials
});

Environment Variables

  • ECHO_BASE_URL: Base URL for the Echo API (default: http://localhost:3000)

API Reference

EchoClient

Constructor

new EchoClient(config?: Partial<EchoConfig>)

Methods

getBalance(echoAppId?: string): Promise<Balance>

Get account balance, optionally for a specific app.

listEchoApps(): Promise<EchoApp[]>

List all Echo apps for the authenticated user.

getEchoApp(appId: string): Promise<EchoApp>

Get details for a specific Echo app.

createPaymentLink(request: CreatePaymentLinkRequest): Promise<CreatePaymentLinkResponse>

Create a Stripe payment link for purchasing credits.

getPaymentUrl(amount: number, echoAppId: string, description?: string): Promise<string>

Convenience method to get a payment URL for purchasing credits.

getAppUrl(appId: string): string

Get the web URL for accessing an Echo app.

Types

Balance

interface Balance {
  balance: string;
  totalPaid: string;
  totalSpent: string;
  currency: string;
  echoAppId?: string | null;
}

EchoApp

interface EchoApp {
  id: string;
  name: string;
  description?: string;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
  userId: string;
  totalTokens?: number;
  totalCost?: number;
  // ... other fields
}

CreatePaymentLinkRequest

interface CreatePaymentLinkRequest {
  amount: number; // Amount in USD
  description?: string;
  echoAppId: string;
}

Security

API keys are stored securely using the system keychain:

  • macOS: Keychain Access
  • Windows: Credential Vault
  • Linux: libsecret

Never commit API keys to version control. Use environment variables or the CLI's secure storage.

Error Handling

The SDK throws descriptive errors for common issues:

try {
  const balance = await client.getBalance();
} catch (error) {
  if (error.message.includes('Authentication required')) {
    console.log('Please run "npx echo-cli login" to authenticate');
  } else {
    console.error('API Error:', error.message);
  }
}

Development

# Install dependencies
pnpm install

# Build the SDK
pnpm run build

# Run tests
pnpm test

# Watch mode for development
pnpm run dev

License

MIT