Announcing Zoom Rivet for JavaScript!

Zoom Rivet

We're excited to announce the initial release of Zoom Rivet, 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 authorization, API wrappers, and event subscriptions, enabling developers to focus on business logic instead of infrastructure. Support for Python and Java is also on the roadmap for future releases.

Zoom Rivet for JavaScript modules

Zoom Chat

Custom features and integrations that enhance team communication in Zoom Chat

Chatbot

Tools and libraries to build chatbots in the Zoom platform

Users

Access data in your Zoom account's users, groups, and contact groups

Video SDK

Enhance your custom video experience with event-driven session analytics and server-side controls

Meetings

Integrate with Zoom Meetings to easily manage and create workflows

Accounts

Access your Zoom account programmatically

Phone

Connect to and access Zoom's feature rich cloud phone system

Getting started with Zoom Rivet

Follow along this brief tutorial to learn how to build with the Zoom Rivet Chatbot module:

Step 1: Set up your project

If you don't already have a Node.js project, you can create a new one.

dir zoom-rivet-app
cd zoom-rivet-app
npm init

Step 2: Installing Zoom Rivet

Install the @zoom/rivet package by calling the following command in the root of your project:

npm install @zoom/rivet

Step 3: Initialize your Zoom Rivet app

Developers can import and initialize the respective client from any supported module by following the pattern shown in the following code snippet. Create a new entrypoint file called index.js, add following code, and replace the ClientId, ClientSecret, and WebhookSecretToken from your Marketplace App.

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 and run the following command to start your local development server:

node index.js

Your server should be up and running 🎉

Step 4: Expose your local development server

Now that you have your app running on your local machine, let's use ngrok to allow Zoom to reach your server via webhook:

ngrok http 8080

By default Zoom Rivet uses port 8080. See the docs to learn how to customize the port number.

ngrok will provide a forwarding address. By providing this address to Zoom, your local development server can now recieve webhook events.

Depending on the Zoom Rivet module you are developing with, there may be different steps to provide this forwarding address to Zoom:

Basic concepts

Authorization

Rivet handles authorization out-of-the-box, so you can spend more time developing critical business logic. Zoom offers several authorization methods depending on the developer product.

Reference the matrix in the table below to see how authorization works for each Zoom Rivet module.

ModuleAuth type
ChatbotClient credentials
Video SDKJSON Web Token
Zoom Chat, Meetings, Phone, Accounts, UsersUser OAuth, Server OAuth

Listening to events

To listen to events sent to your app, you can use the event() method of the eventSubscriptions namespace. In doing so, developers can listen to any supported Zoom Webhook, such as the slash command shown below. This method takes in a required parameter of type string, which filters out webhook events that do not match.

chatbotClient.eventProcessor.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:

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);
    });

Responding to slash commands

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

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

Start building!

Now that you understand the capabilities of Zoom Rivet for JavaScript, its time to start building. For more information on how to get started, see our documentation and sample app. If you have any feedback, please reach out via the Zoom Developer Forum to discuss with Developer Advocates and community developers. For prioritized assistance, take advantage of Premier Developer Support plans.