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

@aiozstream/nodejs-client

v1.0.16

Published

AIOZ stream nodejs API client

Readme

AIOZ Stream is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

Project description

AIOZ Stream's Node.js is a lightweight client built in TypeScript that streamlines the coding process. Chunking files is handled for you, as is pagination and refreshing your tokens.

Getting started

Installation

With npm:

npm install @aiozstream/nodejs-client

...or with yarn:

yarn add @aiozstream/nodejs-client

Code sample

import StreamClient from "@aiozstream/nodejs-client";
 
(async () => {
  try {
    const client = new StreamClient({
      publicKey: "YOUR_PUBLIC_KEY",
      secretKey: "YOUR_SECRET_KEY",
    });
    const videoCreationPayload = {
      title: "First video", // The title of your new video.
      description: "A new video.", // A brief description of your video.
    };
 
    const video = await client.video.create(videoCreationPayload);
    if (!video.data) {
      throw new Error("Failed to create video");
    }
    if (!video.data.id) {
      throw new Error("Failed to create video");
    }
    // Option 1: Use client upload with videoId
    // await client.uploadVideo(video.data.id, "./path/to/video.mp4");
    // console.log("Upload successfully");
    // Option 2: Upload parts yourself
    const uploadResult = await client.video.uploadPart(
      video.data.id,
      "./path/to/video.mp4",
    );
    console.log(uploadResult);
 
    const checkResult = await client.video.uploadVideoComplete(video.data.id);
    // Check if the video upload is complete
    console.log(checkResult);
  } catch (e) {
    console.error(e);
  }
})();


Documentation

API endpoints

AnalyticsApi

Method | Description | HTTP request ------------- | ------------- | ------------- GetAggregatedMetrics() | Get aggregated metrics | POST /analytics/metrics/data/{metric}/{aggregation} GetBreakdownMetrics() | Get breakdown metrics | POST /analytics/metrics/bucket/{metric}/{breakdown} GetDataUsage() | Get data usage | GET /analytics/data GetOvertimeMetrics() | Get overtime metrics | POST /analytics/metrics/timeseries/{metric}/{interval} GetStatisticMedias() | Get statistic media | GET /analytics/media

ApiKeyApi

Method | Description | HTTP request ------------- | ------------- | ------------- create() | Create API key | POST /api_keys update() | Rename api key | PATCH /api_keys/{id} delete() | Delete API key | DELETE /api_keys/{id} list() | Get list API keys | GET /api_keys

LiveStreamApi

Method | Description | HTTP request ------------- | ------------- | ------------- uploadThumbnail() | Upload live stream media thumbnail | POST /live_streams/{id}/thumbnail deleteThumbnail() | Delete live stream media thumbnail | DELETE /live_streams/{id}/thumbnail addMulticast() | Add live stream multicast | POST /live_streams/multicast/{stream_key} createLiveStreamKey() | Create live stream key | POST /live_streams createStreaming() | Create a new live stream media | POST /live_streams/{id}/streamings deleteLiveStreamKey() | Delete live stream key | DELETE /live_streams/{id} deleteLiveStreamMulticast() | Delete live stream multicast | DELETE /live_streams/multicast/{stream_key} deleteStreaming() | Delete live stream video | DELETE /live_streams/{id}/streamings/{stream_id} getLiveStreamKey() | Get live stream key | GET /live_streams/{id} getLiveStreamKeys() | Get live stream key list | GET /live_streams getLiveStreamMulticastByStreamKey() | Get live stream multicast by stream key | GET /live_streams/multicast/{stream_key} getLiveStreamPlayerInfo() | Get live stream video public | GET /live_streams/player/{id}/media getLiveStreamStatisticByStreamMediaId() | Get live stream statistic by stream media id | GET /live_streams/statistic/{stream_media_id} getLiveStreamVideo() | Get live stream video | GET /live_streams/{id}/video getMedias() | Get live stream media | POST /live_streams/{id}/media getStreaming() | Get live stream media streaming | GET /live_streams/{id}/streamings/{stream_id} getStreamings() | Get live stream media streamings | GET /live_streams/{id}/streamings updateLiveStreamKey() | Update live stream key | PUT /live_streams/{id} updateMedia() | Update live stream media | PUT /live_streams/{id}/streamings

MediaApi

Method | Description | HTTP request ------------- | ------------- | ------------- create() | Create media object | POST /media/create update() | update media info | PATCH /media/{id} delete() | Delete media | DELETE /media/{id} uploadThumbnail() | Upload media thumbnail | POST /media/{id}/thumbnail deleteThumbnail() | Delete media thumbnail | DELETE /media/{id}/thumbnail createCaption() | Create a new media caption | POST /media/{id}/captions/{lan} deleteCaption() | Delete a media caption | DELETE /media/{id}/captions/{lan} getCaptions() | Get media captions | GET /media/{id}/captions getCost() | get media transcoding cost | GET /media/cost getDetail() | get media detail | GET /media/{id} getMediaList() | Get user videos list | POST /media getMediaPlayerInfo() | Get media object | GET /media/{id}/player.json setDefaultCaption() | Set default caption | PATCH /media/{id}/captions/{lan} uploadMediaComplete() | Get upload media when complete | GET /media/{id}/complete uploadPart() | Upload part of media | POST /media/{id}/part

MediaChapterApi

Method | Description | HTTP request ------------- | ------------- | ------------- create() | Create a media chapter | POST /media/{id}/chapters/{lan} get() | Get media chapters | GET /media/{id}/chapters delete() | Delete a video chapter | DELETE /media/{id}/chapters/{lan}

PlayersApi

Method | Description | HTTP request ------------- | ------------- | ------------- create() | Create a player theme | POST /players get() | Get a player theme by ID | GET /players/{id} update() | Update a player theme by ID | PATCH /players/{id} delete() | Delete a player theme by ID | DELETE /players/{id} list() | List all player themes | GET /players uploadLogo() | Upload a logo for a player theme by ID | POST /players/{id}/logo deleteLogo() | Delete a logo for a player theme by ID | DELETE /players/{id}/logo addPlayer() | Add a player theme to a video | POST /players/add-player removePlayer() | Remove a player theme from a video | POST /players/remove-player

PlaylistApi

Method | Description | HTTP request ------------- | ------------- | ------------- addVideoToPlaylist() | Add a video to a playlist | POST /playlists/{id}/items createPlaylist() | Create a playlist | POST /playlists/create deletePlaylistById() | Delete a playlist by ID | DELETE /playlists/{id} deletePlaylistThumbnail() | Delete a playlist thumbnail | DELETE /playlists/{id}/thumbnail getPlaylistById() | Get playlist by ID | GET /playlists/{id} getPlaylistPublicInfo() | Get a playlist public | GET /playlists/{id}/player.json getPlaylists() | Get user's playlists | POST /playlists moveVideoInPlaylist() | Move a video in a playlist | PUT /playlists/{id}/items removeMediaFromPlaylist() | Remove a media from a playlist | DELETE /playlists/{id}/items/{item_id} updatePlaylist() | Update a playlist | PATCH /playlists/{id}

UserApi

Method | Description | HTTP request ------------- | ------------- | ------------- GetMe() | Get me | GET /user/me

WebhookApi

Method | Description | HTTP request ------------- | ------------- | ------------- create() | Create webhook | POST /webhooks get() | Get user's webhook by id | GET /webhooks/{id} update() | Update event webhook | PATCH /webhooks/{id} delete() | Delete webhook | DELETE /webhooks/{id} list() | Get list webhooks | GET /webhooks check() | Check webhook by id | POST /webhooks/check/{id}

Models

Rate Limiting

AIOZ Stream implements rate limiting to ensure fair usage and stability of the service. The API provides the rate limit values in the response headers for any API requests you make. In this Node.js client, you can access these headers by using the *WithResponseHeaders() versions of the methods. These methods return both the response body and the headers, allowing you to check the X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Retry-After headers to understand your current rate limit status.

Here is an example of how to use these methods:

const client = new StreamClient({
  secretKey: "YOUR_SECRET_KEY",
  publicKey: "YOUR_PUBLIC_KEY"
});

const { headers, body } = const webhook = await client.webhook.listWithResponseHeaders();

Authorization

API key and public key

All endpoints required to be authenticated using the API key and public key mechanism described in our documentation.

All you have to do is provide an API key and public key when instantiating the StreamClient:

const client = new StreamClient({
  secretKey: "YOUR_SECRET_KEY",
  publicKey: "YOUR_PUBLIC_KEY"
});

Have you gotten use from this API client?

Please take a moment to leave a star on the client ⭐

This helps other users to find the clients and also helps us understand which clients are most popular. Thank you!