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

tap-sdk-js

v1.1.3

Published

![Logo](https://capsule-render.vercel.app/api?type=waving&height=300&color=gradient&text=Zako%20TapSDK.js&textBg=false)

Readme

Logo

Zako Tap SDK js

NPM Version

This is the javascript sdk package required to create a javascript tap server responsible for the audio of zako, a discord audio bot.

Quickstart Example

First, you need to download tap-sdk-js on your project.

npm install tap-sdk-js

Then, you can use the sdk. Here is some example.

import { createClient } from "tap-sdk-js";

const client = createClient({
  name: "your zako tap server name",
  token: "your zako tap server token",
  zakoEndpoint: "zako endpoint (default is https://api.zako.ac)",
});

client.events.on("ready", () => {
  console.log("ready");
});

client.events.on("request", (handle) => {
  const { data, parameters } = handle;
  // data is the actual data to handle.

  // to respond the stream
  handle.respond(/* stream here */);

  // call this on error
  handle.respondError("error message");
});

client.events.on("connectionError", (e) => {
  console.error(e);
});

client.events.on("error", (e) => {
  console.error(e);
});

client.connect();

Client Description

1. Create Client and Connect

You can create tap server client by call createClient function in tap-sdk-js package.

You should put the client data written as ZakoTapConfig type inside the argument of createClient.

You can then connect to the tab server using client.connect().

import { createClient } from "zako-sdk-js"

const client = createClient({
    name: "your zako tap server name",
    token: "your zako tap server token",
    zakoEndpoint: "zako endpoint (option)"
    backoffBaseMs: "loop waiting time (option)";
});

client.connect();

2. Client Event

Using the client created above, you can use client.on to perform a specific function when the EventEmitter's event is called.

client.events.on("event name", function)

The types of events are specified in TapEvents among the types in the zakotap package.

Tap Events

  • ready: This event is called when the zako tap server successfully connects to the zako tap hub.
  • request: This event is called when an audio request is received from the zako tap hub.
  • connectionError: This event is called when an connection error occurs within the zakotap package.
  • error: This event is called when an error occurs within the zakotap package.

3. Send Audio

You can send your audio stream by using handle.respond() function.

handle.respond("your audio stream");

You can get audio request handle from request event parameter. If you don't send an audio stream, your tap server will be considered offline and you may be disconnected.

Work Flow

sequenceDiagram
    participant TapServer
    participant TapHub

    TapServer->>TapHub: WS TapHello
    TapHub-->>TapServer: WS TapResponse
    Note right of TapServer: Waiting for audio request
    TapHub-->>TapServer: WS AudioRequest
    TapServer->>TapHub: POST AudioStream

Related Documents

Authors