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

zymu

v0.1.15

Published

@zymuapp's sdk and tools for node.js

Readme

zymu

npm version License: MIT

A TypeScript SDK for interacting with the Zymu API in Node.js applications.

Installation

# Using npm
npm install zymu

# Using yarn
yarn add zymu

# Using pnpm
pnpm add zymu

Quick Start

import { zymu } from 'zymu';

// Initialize the SDK
const app = new zymu({
  baseURL: 'https://api.zymu.app'  // Default if not specified
});

// Authentication examples
async function authenticate() {
  try {
    // Sign up a new user
    const newUser = await app.auth.signUp({
      identifier: {
        username: 'newuser123',
      },
      identity: {
        displayName: 'New User',
      },
      password: 'Password123!',
    });
    console.log('User created:', newUser);
    
    // Sign in with credentials
    const user = await app.auth.signIn({
      identifier: 'myusername',
      password: 'MySecurePassword123!',
    });
    console.log('Signed in as:', user);
    
    // Get available OAuth providers
    const providers = await app.auth.providers();
    console.log('Available OAuth providers:', providers);
    
    // Sign out
    await app.auth.signOut();
    console.log('Signed out successfully');
  } catch (error) {
    console.error('Authentication error:', error);
  }
}

Features

  • Authentication: Sign up, sign in, sign out, and refresh tokens
  • OAuth2 Support: Connect with Discord, Google, Apple, Spotify, TikTok, Twitch, and Twitter
  • Type Safety: Full TypeScript support with comprehensive type definitions
  • HTTP Client: Built-in REST client for making API requests
  • Validation: Request and response validation using class-validator
  • Cross-platform: Works in both Node.js and browser environments

Authentication

Sign Up

Create a new user account:

const user = await app.auth.signUp({
  identifier: {
    username: 'newuser',
    // Optional fields
    email: '[email protected]',
    phoneNumber: '+12345678901',
  },
  identity: {
    displayName: 'New User',
  },
  password: 'SecurePassword123!',
});

Sign In

Authenticate using username/email and password:

const user = await app.auth.signIn({
  identifier: 'username_or_email',
  password: 'YourPassword123!',
});

OAuth2 Authentication

In browser environments, you can use OAuth providers:

// Redirect to OAuth provider
app.auth.oauth2.google.connect({
  redirect_uri: 'https://yourapp.com/callback',
});

// Other providers
app.auth.oauth2.discord.connect({ redirect_uri: '...' });
app.auth.oauth2.apple.connect({ redirect_uri: '...' });
app.auth.oauth2.spotify.connect({ redirect_uri: '...' });
// etc.

Token Management

Refresh authentication token:

await app.auth.refreshToken();

Sign out:

await app.auth.signOut();

API Client

For direct API interactions:

// GET request
const response = await app.client.get('/endpoint', { 
  param1: 'value1', 
  param2: 'value2' 
});

// POST request
const response = await app.client.post('/endpoint', { 
  field1: 'value1',
  field2: 'value2'
});

// Other methods
app.client.put(...);
app.client.patch(...);
app.client.delete(...);

Types

The SDK includes comprehensive TypeScript definitions for all API entities:

  • User: User profile and authentication data
  • UserIdentifier: User identification fields
  • UserIdentity: User profile information
  • UserSettings: User preferences and settings
  • And many more...

Error Handling

The SDK throws typed errors that can be caught and handled:

try {
  await app.auth.signIn({
    identifier: 'username',
    password: 'incorrect-password',
  });
} catch (error) {
  if (error.status === 401) {
    console.error('Invalid credentials');
  } else {
    console.error('Authentication error:', error.message);
  }
}

Development

# Install dependencies
npm install

# Build the SDK
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Type check
npm run check-types

License

MIT © zymuapp