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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zoom/rivet

v0.0.1

Published

Zoom Rivet is a comprehensive toolkit built to help developers quickly integrate and manage server-side applications within the Zoom ecosystem. This tool currently supports Node.js, offering core functionalities like authentication, API wrappers, and even

Downloads

63

Readme

Zoom Rivet for JavaScript

Zoom Rivet is a comprehensive toolkit built to help developers quickly integrate and manage server-side applications within the Zoom ecosystem. This tool currently supports Node.js, offering core functionalities like authentication, API wrappers, and event subscriptions, enabling developers to focus on business logic instead of infrastructure.

Getting started

Installation

In your Node.js application, install the Zoom Rivet package:

$ npm install @zoom/rivet

Initialization

You can import and initialize the client from any supported module using the pattern for the Chatbot module in the code snippet below.

In a new entrypoint file called index.js, add the following code, replacing CLIENT_ID, CLIENT_SECRET, and WEBHOOK_SECRET_TOKEN with your Marketplace app credentials:

import { ChatbotClient } from "@zoom/rivet/chatbot";

(async () => {
  const chatbotClient = new ChatbotClient({
    clientId: "CLIENT_ID",
    clientSecret: "CLIENT_SECRET",
    webhooksSecretToken: "WEBHOOK_SECRET_TOKEN"
  });

  // Zoom Rivet code goes here!

  const server = await chatbotClient.start();
  console.log(`Zoom Rivet Events Server running on: ${JSON.stringify(server.address())}`);
})();

Save your index.js file and run the following command to start your local development server:

$ node index.js

Expose local development server

Now that your app runs on your local machine, let's use ngrok to allow Zoom to reach your server through webhook:

$ ngrok http 8080

Basic Concepts

To use Zoom Rivet effectively, you should understand three important concepts: authentication, listening to events, and using the Web API.

Authentication

Zoom Rivet handles authentication for developers. All you have to do is provide your app's ClientId and ClientSecret. See the matrix in the table below to better how authentication works in each Rivet module:

| Module | Auth Type | | --------- | -------------------------------------------------------------------------------------------------------------------- | | Team Chat | OAuth | | Chatbot | Client Credentials | | Users | OAuth | | Video SDK | JWT |

Listening to Events

To listen to events sent to your app, you can use the event() method in the webEventConsumer property. This method can be used to listen to any supported Zoom webhook event, like a slash command shown below.

This method receives a required parameter of string, which filters out webhook events that do not match.

chatbotClient.webEventConsumer.event("bot_notification", (response) => {
  const payload = response.payload;
  console.log(payload);
});

Using the Web API

You can call any of the supported Zoom APIs using their respective methods in the endpoints namespace of the module's client.

See the following example of the sendChatbotMessage() API from the Chatbot module:

const reqBody = {
  robot_jid: payload.robotJid,
  account_id: payload.accountId,
  to_jid: payload.toJid,
  user_jid: payload.userJid,
  content: {
    head: {
      text: "I am a header",
      sub_head: {
        text: "I am a sub header"
      }
    },
    body: [
      {
        type: "message",
        text: "I am a message with text"
      }
    ]
  }
};

chatbotClient.endpoints.messages.sendChatbotMessage({ body: reqBody }).then((response) => {
  console.log("SENT MESSAGE", response.data);
});

Event shortcuts

Rivet provides built-in shortcuts that enable you to execute complex processes in just a few lines of code.

Chatbot

onSlashCommand()

Your app can use the onSlashCommand() method to listen to incoming slash command requests. Use the say() method to respond to slash commands. It accepts a string or App Card JSON.

chatbotClient.webEventConsumer.onSlashCommand("SLASH_COMMAND", async ({ say, payload }) => {
  console.log(payload);
  await say("Hello World!");
});
onButtonClick()

Your app can listen to button clicks and respond using the onButtonClick() method. This method takes in a string, which filters button action values. You can respond with the say() function, which accepts a string or App Card JSON.

chatbotClient.webEventConsumer.onButtonClick("BUTTON_VALUE", async ({ say, payload }) => {
  console.log(payload);
  await say("Hello World!");
});

Team Chat

onChannelMessagePosted()

You can use the onChannelMessagePosted() method to listen to messages that your app can receive. You can use the reply() method to respond to slash commands. It accepts a string or App Card JSON.

teamchatClient.webEventConsumer.onChannelMessagePosted("KEYWORD", async ({ reply, payload }) => {
  console.log(payload);
  await reply("Hello World!");
});

For the full list of features and additional guides, see our Zoom Rivet docs.

Sample Apps

Need help?

If you're looking for help, try Developer Support or our Developer Forum. Priority support is also available with Premier Developer Support plans.