{"id":22026043,"url":"https://github.com/zoom/rivet-javascript","last_synced_at":"2025-05-07T10:15:23.676Z","repository":{"id":264062133,"uuid":"881182353","full_name":"zoom/rivet-javascript","owner":"zoom","description":"Zoom's API Library, webhook server, and authentication tool for developers","archived":false,"fork":false,"pushed_at":"2025-04-16T16:45:19.000Z","size":1723,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T10:15:08.438Z","etag":null,"topics":["npm-package"],"latest_commit_sha":null,"homepage":"https://developers.zoom.us/docs/rivet/javascript","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-31T03:42:05.000Z","updated_at":"2025-04-13T21:14:19.000Z","dependencies_parsed_at":"2024-11-21T20:21:50.035Z","dependency_job_id":null,"html_url":"https://github.com/zoom/rivet-javascript","commit_stats":null,"previous_names":["zoom/rivet-javascript"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoom%2Frivet-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoom%2Frivet-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoom%2Frivet-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoom%2Frivet-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoom","download_url":"https://codeload.github.com/zoom/rivet-javascript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252856558,"owners_count":21814858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["npm-package"],"created_at":"2024-11-30T07:24:47.754Z","updated_at":"2025-05-07T10:15:23.666Z","avatar_url":"https://github.com/zoom.png","language":"JavaScript","readme":"# Zoom Rivet for JavaScript\n\nZoom 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.\n\n## Getting started\n\n### Installation\n\nIn your Node.js application, install the Zoom Rivet package:\n\n```\n$ npm install @zoom/rivet\n```\n\n### Initialization\n\nYou can import and initialize the client from any [supported module](https://developers.zoom.us/docs/rivet/#modules) using the pattern for the Chatbot module in the code snippet below.\n\nIn a new entrypoint file called `index.js`, add the following code, replacing `CLIENT_ID`, `CLIENT_SECRET`, and `WEBHOOK_SECRET_TOKEN` with your [Marketplace app](https://marketplace.zoom.us) credentials:\n\n```javascript\nimport { ChatbotClient } from \"@zoom/rivet/chatbot\";\n\n(async () =\u003e {\n  const chatbotClient = new ChatbotClient({\n    clientId: \"CLIENT_ID\",\n    clientSecret: \"CLIENT_SECRET\",\n    webhooksSecretToken: \"WEBHOOK_SECRET_TOKEN\"\n  });\n\n  // Zoom Rivet code goes here!\n\n  const server = await chatbotClient.start();\n  console.log(`Zoom Rivet Events Server running on: ${JSON.stringify(server.address())}`);\n})();\n```\n\nSave your `index.js` file and run the following command to start your local development server:\n\n```\n$ node index.js\n```\n\n### Expose local development server\n\nNow that your app runs on your local machine, let's use [ngrok](https://ngrok.com/) to allow Zoom to reach your server through webhook:\n\n```\n$ ngrok http 8080\n```\n\n## Basic Concepts\n\nTo use Zoom Rivet effectively, you should understand three important concepts: authentication, listening to events, and using the Web API.\n\n### Authentication\n\nZoom 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:\n\n| Module                                      | Auth Type                                                                                                                   |\n| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |\n| Chatbot                                     | [Client Credentials](https://developers.zoom.us/docs/team-chat-apps/installation-and-authentication/#authentication)        |\n| Video SDK                                   | [JWT](https://developers.zoom.us/docs/video-sdk/api-request/)                                                               |\n| Team Chat, Meetings, Phone, Accounts, Users | [User OAuth](https://developers.zoom.us/docs/integrations/), [Server OAuth](https://developers.zoom.us/docs/internal-apps/) |\n\n### Listening to Events\n\nTo 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.\n\nThis method receives a required parameter of `string`, which filters out webhook events that do not match.\n\n```javascript\nchatbotClient.webEventConsumer.event(\"bot_notification\", (response) =\u003e {\n  const payload = response.payload;\n  console.log(payload);\n});\n```\n\n### Using the Web API\n\nYou can call any of the supported Zoom APIs using their respective methods in the `endpoints` namespace of the module's client.\n\nSee the following example of the `sendChatbotMessage()` API from the Chatbot module:\n\n```javascript\nconst reqBody = {\n  robot_jid: payload.robotJid,\n  account_id: payload.accountId,\n  to_jid: payload.toJid,\n  user_jid: payload.userJid,\n  content: {\n    head: {\n      text: \"I am a header\",\n      sub_head: {\n        text: \"I am a sub header\"\n      }\n    },\n    body: [\n      {\n        type: \"message\",\n        text: \"I am a message with text\"\n      }\n    ]\n  }\n};\n\nchatbotClient.endpoints.messages.sendChatbotMessage({ body: reqBody }).then((response) =\u003e {\n  console.log(\"SENT MESSAGE\", response.data);\n});\n```\n\n### Event shortcuts\n\nRivet provides built-in shortcuts that enable you to execute complex processes in just a few lines of code.\n\n#### Chatbot\n\n##### `onSlashCommand()`\n\nYour app can use the `onSlashCommand()` method to listen to incoming slash command requests.\nUse the `say()` method to respond to slash commands. It accepts a string or [App Card JSON](https://developers.zoom.us//docs/team-chat-apps/customizing-messages/).\n\n```javascript\nchatbotClient.webEventConsumer.onSlashCommand(\"SLASH_COMMAND\", async ({ say, payload }) =\u003e {\n  console.log(payload);\n  await say(\"Hello World!\");\n});\n```\n\n##### `onButtonClick()`\n\nYour app can listen to button clicks and respond using the `onButtonClick()` method. This method takes in a string, which filters button action values.\nYou can respond with the `say()` function, which accepts a string or [App Card JSON](https://developers.zoom.us//docs/team-chat-apps/customizing-messages/).\n\n```javascript\nchatbotClient.webEventConsumer.onButtonClick(\"BUTTON_VALUE\", async ({ say, payload }) =\u003e {\n  console.log(payload);\n  await say(\"Hello World!\");\n});\n```\n\n#### Team Chat\n\n##### `onChannelMessagePosted()`\n\nYou can use the `onChannelMessagePosted()` method to listen to messages that your app can receive.\nYou can use the `reply()` method to respond to slash commands. It accepts a string or App Card JSON.\n\n```javascript\nteamchatClient.webEventConsumer.onChannelMessagePosted(\"KEYWORD\", async ({ reply, payload }) =\u003e {\n  console.log(payload);\n  await reply(\"Hello World!\");\n});\n```\n\n**For the full list of features and additional guides, see our [Zoom Rivet docs](https://developers.zoom.us/docs/rivet).**\n\n## Sample Apps\n\n- [Zoom Rivet for JavaScript sample app](https://github.com/zoom/rivet-javascript-sample)\n\n## Need help?\n\nIf you're looking for help, try [Developer Support](https://developers.zoom.us/support/) or our [Developer Forum](https://devforum.zoom.us/). Priority support is also available with [Premier Developer Support](https://explore.zoom.us/en/support-plans/developer/) plans.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoom%2Frivet-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoom%2Frivet-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoom%2Frivet-javascript/lists"}