# 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](/docs/api/chat/) Custom features and integrations that enhance team communication in Zoom Chat ### [Chatbot](/docs/api/chatbot/) Tools and libraries to build chatbots in the Zoom platform ### [Users](/docs/api/users/) Access data in your Zoom account's users, groups, and contact groups ### [Video SDK](/docs/api/video-sdk) Enhance your custom video experience with event-driven session analytics and server-side controls ### [Meetings](/docs/api/meetings/) Integrate with Zoom Meetings to easily manage and create workflows ### [Accounts](/docs/api/accounts/) Access your Zoom account programmatically ### [Phone](/docs/api/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. ```shell 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: ```shell 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](https://marketplace.zoom.us). ```javascript 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: ```shell 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](https://ngrok.com/) to allow Zoom to reach your server via webhook: ```shell ngrok http 8080 ``` By default Zoom Rivet uses port 8080. See the docs to learn [how to customize the port number](/docs/rivet/javascript/config-options/#custom-port). [ngrok](https://ngrok.com/) 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: - [Zoom Chat](/docs/chat/create/#bot-jid) - [Chatbot](/docs/chat/create-chatbot/#step-3-select-zoom-products-and-features) - [Video SDK](/docs/chat/create-chatbot/#step-3-select-zoom-products-and-features) ## 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. | Module | Auth type | | ------------------------------------------- | -------------------------------------------------------------------------------- | | Chatbot | [Client credentials](/docs/chat/installation-and-authentication/#authentication) | | Video SDK | [JSON Web Token](/docs/build/api-request/) | | Zoom Chat, Meetings, Phone, Accounts, Users | [User OAuth](/docs/integrations/), [Server OAuth](/docs/internal-apps/) | ### 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](/docs/api/chatbot/), such as the slash command shown below. This method takes in a required parameter of type `string`, which filters out [webhook events](/docs/api/chatbot/events) that do not match. ```javascript 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](/docs/api/chatbot/) using their respective methods in the `endpoints` namespace of the module's client. See the following example of the `sendChatbotMessage` API: ```javascript 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](/docs/chat/customizing-messages/) ```javascript 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](/docs/rivet) and [sample app](https://github.com/zoom/rivet-javascript-sample). If you have any feedback, please reach out via the [Zoom Developer Forum](https://devforum.zoom.us/) to discuss with Developer Advocates and community developers. For prioritized assistance, take advantage of [Premier Developer Support plans](https://explore.zoom.us/en/support-plans/developer/).