### Start Archive with Vonage Video Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Starts an archive for a given session with optional configuration. This initiates the recording of a video session. ```ts const archive = await videoClient.startArchive(SESSION_ID); console.log(archive.id); ``` -------------------------------- ### Start Experience Composer Render with Vonage Video Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Starts rendering an experience composer with the provided configuration. This initiates the creation of a custom video layout or composition. ```ts const render = await videoClient.startExperienceComposerRender( SESSION_ID, token, ) console.log(render.id); ``` -------------------------------- ### Install Vonage Pricing SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/pricing/v2_TO_v3_MIGRATION_GUIDE.md Instructions for installing the `@vonage/pricing` package as a standalone module using npm, separate from the main Vonage Node SDK. ```console $ npm install @vonage/pricing ``` -------------------------------- ### Install Vonage Verify SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/verify/v2_TO_v3_MIGRATION_GUIDE.md Instructions on how to install the Vonage Verify SDK as a standalone package using npm. This package is a companion to the core Vonage Node SDK. ```console $ npm install @vonage/verify ``` -------------------------------- ### Start Broadcast with Vonage Video Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Starts a broadcast for a given session with the specified configuration. This enables live streaming of a video session to external platforms. ```ts const broadcast = await videoClient.startBroadcast( SESSION_ID, { outputs: { hls: { lowLatency: true, } rtmp: [{ serverUrl: 'rtmp://example.com', }], } } ); ``` -------------------------------- ### Install Vonage Accounts SDK standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/accounts/v2_TO_v3_MIGRATION_GUIDE.md Instructions to install the Vonage Accounts SDK as a standalone package using npm, separate from the main Vonage Node SDK. ```console $ npm install @vonage/accounts ``` -------------------------------- ### Install Vonage Applications SDK via npm Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/applications/v2_TO_v3_MIGRATION_GUIDE.md Instructions to install the Vonage Applications SDK as a standalone package using npm, providing an alternative to the full Vonage Node SDK. ```console $ npm install @vonage/applications ``` -------------------------------- ### Install Vonage Voice Standalone SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/voice/v2_TO_v3_MIGRATION_GUIDE.md Instructions for installing the @vonage/voice package as a standalone module using npm. This package is a companion to the core Vonage Node SDK. ```console $ npm install @vonage/voice ``` -------------------------------- ### Install Vonage Numbers SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/numbers/v2_TO_v3_MIGRATION_GUIDE.md Instructions to install the Vonage Numbers SDK as a standalone package using npm, separate from the main Vonage Server SDK. ```console $ npm install @vonage/numbers ``` -------------------------------- ### Instantiate Verify Client from Vonage Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Demonstrates how to obtain a `Verify` client instance from an existing `Vonage` client. This method simplifies client setup by leveraging the main Vonage client's authentication. ```ts import { Vonage } from '@vonage/server-client'; const vonage = new Vonage({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); const verifyClient = vonage.verify; ``` -------------------------------- ### Configure Vonage Server SDK and access Accounts client Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/accounts/v2_TO_v3_MIGRATION_GUIDE.md Demonstrates how to initialize the main Vonage Node Server SDK with application credentials and access the accounts client. It highlights the change in accessor from `vonage.account` to `vonage.accounts` and shows how to get the account balance using promises. ```javascript const Vonage = require('@vonage/server-sdk'); const vonage = new Vonage({ applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }); vonage.accounts.getBalance() .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` -------------------------------- ### Create Vonage Video Client from Vonage Server Client Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Initializes the Video client as a sub-client of the main Vonage server client. This approach integrates video functionalities within a broader Vonage SDK setup. ```ts import { Vonage } from '@vonage/server-client'; const vonage = new Vonage({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); const videoClient = vonage.video; ``` -------------------------------- ### Start Vonage Verification Request (Basic) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Initiates a new verification request to a specified number and brand. This snippet demonstrates how to start a basic verification flow and handle the success or failure of the request based on the 'requestId'. ```ts const result = await verifyClient.start({ number: TO_NUMBER, brand: BRAND_NAME }); if (result.requestId) { console.log(`Request started with id ${result.requestId}`); } else { console.log(`Request failed with error: ${result.errorText}`); } ``` -------------------------------- ### Reviewing and Testing a Pull Request for Vonage Node.js SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/CONTRIBUTING.md This snippet provides the command-line steps to clone the Vonage Node.js SDK repository, switch to a specific branch, install dependencies, compile the project, and then link the local SDK to a separate code snippets repository for testing. It ensures proper setup for reviewing proposed changes. ```Shell git clone https://github.com/vonage/vonage-node-sdk.git cd vonage-node-sdk git checkout BRANCH_NAME npm install npm run compile # In a new directory, download the vonage-node-code-snippets repository, e.g., # git clone https://github.com/Vonage/vonage-node-code-snippets npm i /path/to/vonage-node-sdk # Copy .env-example to .env and update any variables required, e.g., # cp .env-example .env # Run the sample code snippet to test the SDK. ``` -------------------------------- ### Install Vonage Number Insights SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/number-insights/v2_TO_v3_MIGRATION_GUIDE.md Instructions to install the Vonage Number Insights SDK as a standalone package using npm, separate from the main Vonage Node SDK. ```console $ npm install @vonage/number-insights ``` -------------------------------- ### Instantiate Vonage Accounts Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Examples demonstrating how to create an instance of the `Accounts` client, either directly as a standalone client or by deriving it from the main `Vonage` server-client, using API key and secret for authentication. ```ts import { Accounts } from '@vonage/account'; const accountClient = new Accounts({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); ``` ```ts import { Vonage } from '@vonage/server-client'; const vonage = new Vonage({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); const accountClient = vonage.account; ``` -------------------------------- ### Install Vonage Node.js SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md Instructions to install the Vonage Server Client SDK for Node.js using the npm package manager. ```bash npm install @vonage/server-client ``` -------------------------------- ### Uninstalling OpenTok and Installing Vonage Server SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/video/OPENTOK_TO_VONAGE_MIGRATION.md Instructions to remove the old `opentok` package and install the new `@vonage/server-sdk` using npm. This is the initial step required for migrating to the new Vonage Video SDK, which is now a companion to the core Vonage Node SDK. ```console $ npm uninstall opentok $ npm install -s @vonage/server-sdk ``` -------------------------------- ### Install Vonage Messages SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/messages/v2_TO_v3_MIGRATION_GUIDE.md Instructions on how to install the `@vonage/messages` package as a standalone module using npm. This package is a companion to the core Vonage Node SDK. ```console $ npm install @vonage/messages ``` -------------------------------- ### Initializing Vonage Video Client as Standalone Module Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/video/OPENTOK_TO_VONAGE_MIGRATION.md Shows how to use the Vonage Video module independently, without the full Vonage Node Server SDK. This setup requires passing the private key as a string and allows for specifying a custom `baseUrl`, which is recommended for accessing development or QA environments. ```js const { Video } = require('@vonage/video'); const vonage = new Video({ applicationId: APP_ID, privateKey: PRIVATE_KEY_STRING, baseUrl: 'https://video.dev.api.vonage.com', }); const session = await vonage.createSession(); ``` -------------------------------- ### Initialize Vonage Server SDK for Voice API Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/voice/v2_TO_v3_MIGRATION_GUIDE.md Example of configuring the main Vonage Node Server SDK with an application ID and private key. The Voice client becomes accessible via vonage.voice for operations like retrieving call details. ```javascript const Vonage = require('@vonage/server-sdk'); const vonage = new Vonage({ applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }); vonage.voice.getCall(CALL_UUID) .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` -------------------------------- ### List All Applications with Pagination (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves all applications by iterating over paginated results. This example demonstrates how to use an async iterator to fetch all available applications sequentially. ```ts for await (const application of applicationClient.listAllApplications()) { console.log(application.name); } ``` -------------------------------- ### Initialize Vonage Voice Standalone SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/voice/v2_TO_v3_MIGRATION_GUIDE.md Demonstrates how to import and initialize the @vonage/voice module when used as a standalone package. This setup allows direct access to Voice API functionalities without the full server SDK. ```javascript const { Voice } = require('@vonage/voice'); ``` -------------------------------- ### Install Vonage Applications SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/applications/README.md Commands to install the Vonage Applications SDK package using either npm or yarn. ```bash npm install @vonage/applications ``` ```bash yarn add @vonage/applications ``` -------------------------------- ### Create Video Session Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Creates a new video session with various configuration options. Examples demonstrate creating sessions with default settings, manual archive mode, specific geographic locations, and routed media mode. ```ts const session = await videoClient.createSession({}); console.log(session.sessionId); ``` ```ts import { ArchiveMode } from '@vonage/video'; const session = await videoClient.createSession({ archiveMode: ArchiveMode.MANUAL, }); console.log(session.sessionId); ``` ```ts const session = await videoClient.createSession({ location: 'eu', }); console.log(session.sessionId); ``` ```ts import { MediaMode } from '@vonage/video'; const session = await videoClient.createSession({ mediaMode: MediaMode.ROUTED, }); console.log(session.sessionId); ``` -------------------------------- ### Install Vonage Node.js SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md Instructions to install the Vonage Server Client SDK for Node.js using the Yarn package manager. ```bash yarn add @vonage/server-client ``` -------------------------------- ### Install Vonage SMS Standalone Package via npm Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/sms/v2_TO_v3_MIGRATION_GUIDE.md Instructions to install the Vonage SMS SDK as a standalone package using npm. This allows for independent usage without the full Vonage Node Server SDK. ```console $ npm install @vonage/sms ``` -------------------------------- ### List a Single Page of Applications (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves a single page of applications with optional pagination parameters. This example shows how to fetch a default or specified page of applications and iterate through them. ```ts const applications = await applicationClient.listApplications({}); applications.applications.forEach(application => { console.log(application.name); }); ``` -------------------------------- ### Retrieve All Themes (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Iterates through and retrieves a list of all available themes. Logs the name and ID of each theme. ```ts for await (const theme of meetingsClient.getThemes()) { console.log(`Theme ${theme.themeName} has ID ${theme.id}`); } ``` -------------------------------- ### Install Vonage SIM Swap SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/network-sim-swap/README.md Command to install the Vonage SIM Swap SDK for Node.js using Yarn. ```bash yarn add @vonage/network-sim-swap ``` -------------------------------- ### Install Vonage Accounts SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/accounts/README.md Installs the Vonage Accounts SDK package using npm, allowing standalone usage of the Accounts API. ```bash npm install @vonage/accounts ``` -------------------------------- ### Install Vonage Accounts SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/accounts/README.md Installs the Vonage Accounts SDK package using Yarn, providing access to the Accounts API. ```bash yarn add @vonage/accounts ``` -------------------------------- ### Install Vonage Network Client with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/network-client/README.md Command to install the Vonage Network Client SDK using Yarn, an alternative package manager for Node.js. This integrates the SDK into your project. ```bash yarn add @vonage/network-client ``` -------------------------------- ### Install Vonage Media SDK for Node.js Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/media/README.md These commands demonstrate how to install the Vonage Media SDK for Node.js using either the npm or Yarn package managers. The SDK provides functionalities for interacting with Vonage Media APIs. ```bash npm install @vonage/media ``` ```bash yarn add @vonage/media ``` -------------------------------- ### Create a New Application (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Creates a new Vonage application with specified capabilities, including voice webhooks. This example demonstrates how to define answerUrl and eventUrl for voice functionality. ```ts const application = await applicationClient.createApplication({ name: 'My Application', capabilities: { voice: { webhooks: { answerUrl: { address: 'https://example.com/answer', httpMethod: 'GET' }, eventUrl: { address: 'https://example.com/event', httpMethod: 'POST' } } } } }); console.log(application.id); ``` -------------------------------- ### Install Vonage Audit SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/audit/README.md Instructions to install the Vonage Audit SDK using npm, for standalone use if only the Audit API is required. ```bash npm install @vonage/audit ``` -------------------------------- ### Install Vonage Network Client with npm Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/network-client/README.md Command to install the Vonage Network Client SDK using npm, the Node.js package manager. This adds the necessary package to your project's dependencies. ```bash npm install @vonage/network-client ``` -------------------------------- ### Retrieve a Page of Applications (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves a specific page of applications based on pagination parameters like page number and size. This example shows how to fetch a subset of applications and iterate through them. ```ts const applications = await applicationClient.getApplicationPage({ page: 1, size: 10 }); applications.applications.forEach(application => { console.log(application.name); }); ``` -------------------------------- ### Install Vonage Verify SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/verify/README.md Instructions for installing the Vonage Verify SDK for Node.js using either npm or yarn. This package is compatible with Verify V1. ```bash npm install @vonage/verify ``` ```bash yarn add @vonage/verify ``` -------------------------------- ### Send GET Request with Vonage Node.js Client Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md Example of sending a GET request to a Vonage API endpoint using the initialized Vonage client. ```js const response = await vonageClient.sendGetRequest('https://rest.nexmo.com/account/numbers') ``` -------------------------------- ### Instantiate Standalone Vonage Number Insights Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Demonstrates how to create an instance of the `NumberInsights` client directly, providing API key and secret for authentication. ```ts import { NumberInsights } from '@vonage/numberInsight'; const numberInsightClient = new NumberInsights({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); ``` -------------------------------- ### Install Vonage Number Insights SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/number-insights/README.md Command to install the Vonage Number Insights SDK using npm. ```bash npm install @vonage/number-insights ``` -------------------------------- ### Install Vonage Meetings SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/meetings/README.md Instructions for installing the Vonage Meetings SDK using either npm or yarn. This SDK can be used standalone or as part of the larger `@vonage/server-sdk` package. ```bash npm install @vonage/meetings ``` ```bash yarn add @vonage/meetings ``` -------------------------------- ### Install Vonage Number Insights SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/number-insights/README.md Command to install the Vonage Number Insights SDK using Yarn. ```bash yarn add @vonage/number-insights ``` -------------------------------- ### List All Events with Pagination (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves all events by iterating over paginated results. This example demonstrates how to use an async iterator to fetch all available events sequentially. ```ts for await (const event of eventClient.listAllEvents()) { console.log(event.name); } ``` -------------------------------- ### Install Vonage Pricing SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/pricing/README.md Instructions to install the Vonage Pricing SDK for Node.js using the npm package manager. This command adds the `@vonage/pricing` package to your project's dependencies. ```bash npm install @vonage/pricing ``` -------------------------------- ### Instantiate Standalone Vonage Media Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Demonstrates how to create an instance of the `Media` client directly, providing API key and secret for authentication. Note: This client is only available as a standalone client. ```ts import { Media } from '@vonage/media'; const mediaClient = new Media({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); ``` -------------------------------- ### Install Vonage SIM Swap SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/network-sim-swap/README.md Command to install the Vonage SIM Swap SDK for Node.js using the Node Package Manager (npm). ```bash npm install @vonage/network-sim-swap ``` -------------------------------- ### Configure Vonage Node SDK with API Key and Secret Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/verify/v2_TO_v3_MIGRATION_GUIDE.md Demonstrates how to initialize the Vonage Node Server SDK with an API Key and Secret. It then shows how to use the `vonage.verify.check` method with Promises for verification. ```js const Vonage = require('@vonage/server-sdk') const vonage = new Vonage({ apiKey: API_KEY, apiSecret: API_SECRET, }) vonage.verify .check(VERIFY_REQUEST_ID, CODE) .then((resp) => console.log(resp)) .catch((err) => console.error(err)) ``` -------------------------------- ### Retrieve an Application by ID (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves the details of a specific Vonage application using its unique identifier. This example demonstrates fetching an application's information. ```ts const application = await applicationClient.getApplication(APPLICATION_ID); console.log(application.name); ``` -------------------------------- ### Install Vonage Vetch SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/vetch/README.md Installs the Vonage Vetch SDK for Node.js using either npm or Yarn package managers, making it available for use in your project. ```bash npm install @vonage/vetch ``` ```bash yarn add @vonage/vetch ``` -------------------------------- ### Install Vonage Audit SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/audit/README.md Instructions to install the Vonage Audit SDK using Yarn, for standalone use if only the Audit API is required. ```bash yarn add @vonage/audit ``` -------------------------------- ### Install Vonage Pricing SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/pricing/README.md Instructions to install the Vonage Pricing SDK for Node.js using the Yarn package manager. This command adds the `@vonage/pricing` package to your project's dependencies. ```bash yarn add @vonage/pricing ``` -------------------------------- ### Initialize Vonage Node SDK with API Credentials Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/pricing/v2_TO_v3_MIGRATION_GUIDE.md Demonstrates how to configure the main `@vonage/server-sdk` with API key and secret, then access and use the `vonage.pricing` client to list country pricing. ```js const Vonage = require('@vonage/server-sdk'); const vonage = new Vonage({ apiKey: API_KEY, apiSecret: API_SECRET, }); vonage.pricing.listCountryPricing() .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` -------------------------------- ### Install Vonage Auth SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md Command to install the Vonage Auth SDK package using npm. This package can be used standalone if only authentication features are required. ```Bash npm install @vonage/auth ``` -------------------------------- ### Install Vonage Node.js SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-sdk/README.md This command installs the Vonage Server SDK for Node.js using the Node Package Manager (NPM). It adds the @vonage/server-sdk package to your project's dependencies, making the SDK available for use. ```bash npm install @vonage/server-sdk ``` -------------------------------- ### Retrieve Meeting Room Pages for a Theme in TypeScript Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves pages of meeting rooms associated with a specific theme. Examples include fetching a default page and a specific page using pageSize and pageNumber parameters. Logs total items and page size for each response. ```ts const resp = await meetingsClient.getRoomsForThemePage('my-theme-id'); console.log(`There are ${resp.totalItems} meeting rooms`); console.log(`There are ${resp.pageSize} meeting rooms per page`); ``` ```ts const resp = await meetingsClient.getRoomsForThemePage('my-theme-id', {pageSize: 10, pageNumber: 2}); console.log(`There are ${resp.totalItems} meeting rooms`); console.log(`There are ${resp.pageSize} meeting rooms per page`); ``` -------------------------------- ### Configure Vonage Server SDK with Application ID and Private Key Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/applications/v2_TO_v3_MIGRATION_GUIDE.md Demonstrates how to initialize the main Vonage Node Server SDK with an application ID and private key. The applications client becomes available as `vonage.applications` for listing applications. ```javascript const Vonage = require('@vonage/server-sdk'); const vonage = new Vonage({ applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }); vonage.applications.listApplications() .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` -------------------------------- ### Initialize Vonage Pricing Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md This snippet demonstrates two methods for initializing the Vonage Pricing client: either as a standalone client with API credentials or by obtaining it from an existing Vonage client instance. The Pricing client provides access to pricing information for various services. ```ts import { Pricing } from '@vonage/pricing'; const pricingClient = new Pricing({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); ``` ```ts import { Vonage } from '@vonage/server-client'; const vonage = new Vonage({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); const pricingClient = vonage.pricing; ``` -------------------------------- ### Install Vonage Users SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/users/README.md This command installs the Vonage Users SDK for Node.js using the npm package manager. It adds the @vonage/users package to your project's dependencies. ```bash npm install @vonage/users ``` -------------------------------- ### List All Conversations with Pagination (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves all conversations by iterating over paginated results. This example demonstrates how to use an async iterator to fetch all available conversations sequentially. ```ts for await (const conversation of conversationClient.listAllConversations()) { console.log(conversation.name); } ``` -------------------------------- ### Install Vonage Verify V2 SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/verify2/README.md Instructions to install the Vonage Verify V2 SDK using the Yarn package manager. This command adds the `@vonage/verify2` package to your project dependencies, enabling the use of the Verify V2 API. ```bash yarn add @vonage/verify2 ``` -------------------------------- ### Install Vonage Video SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/video/README.md These commands demonstrate how to install the Vonage Video SDK for Node.js using either npm or Yarn package managers. The `@vonage/video` package provides access to the Vonage Video API functionalities. ```bash npm install @vonage/video ``` ```bash yarn add @vonage/video ``` -------------------------------- ### Get Video Archive Details Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves detailed information about a specific video archive using its ID. This provides access to metadata like creation time. ```ts const archive = await videoClient.getArchive(ARCHIVE_ID); console.log(archive.createdAt); ``` -------------------------------- ### Install Vonage Node.js SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/README.md Installs the Vonage Server SDK for Node.js using the npm package manager. This command adds the @vonage/server-sdk package to your project's dependencies. ```bash npm install @vonage/server-sdk ``` -------------------------------- ### Initialize Vonage FileClient and Download File Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md Shows how to create a FileClient instance for handling file downloads from Vonage, and then how to use it to download a file by ID or URL. ```js const { Auth } = require('@vonage/auth'); const { FileClient } = require('@vonage/server-client'); const fileClient = new FileClient(new Auth({ apiKey: API_KEY, apiSecret: API_SECRET, applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }), options, ); await fileClient.downloadFile('the-file-id-or-url', '/paht/to/save'); ``` -------------------------------- ### Retrieve a Meeting Recording by ID in TypeScript Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves details of a specific meeting recording using its ID. Logs the recording's ID, start time, and end time. ```ts const recording = await meetingsClient.getRecording('my-recording-id'); console.log(`Recording ${recording.id} started at ${recording.startedAt}`); console.log(`Recording ${recording.id} ended at ${recording.endedAt}`); ``` -------------------------------- ### Get Stream Information with Vonage Video Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves information about one or more streams within a specific session. This allows you to inspect individual stream properties, such as their IDs. ```ts const streamInfo = await videoClient.getStreamInfo(SESSION_ID); if (streamInfo.items) { streamInfo.items.forEach((item) => { console.log(item.id); }); } else { console.log(streamInfo.id); } ``` -------------------------------- ### Install Vonage Users SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/users/README.md This command installs the Vonage Users SDK for Node.js using the Yarn package manager. It adds the @vonage/users package to your project's dependencies. ```bash yarn add @vonage/users ``` -------------------------------- ### Install Vonage Verify V2 SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/verify2/README.md Instructions to install the Vonage Verify V2 SDK using the npm package manager. This command adds the `@vonage/verify2` package to your project dependencies, allowing you to use the Verify V2 API functionalities. ```bash npm install @vonage/verify2 ``` -------------------------------- ### Initiate Outbound Call (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Initiates an outbound call with specified configurations. Examples include creating a call with an answer NCCO (Nexmo Call Control Object) or an answer URL, defining the call's behavior upon connection. ```ts const call = await voiceClient.createOutboundCall({ to: [{ type: 'phone', number: TO_NUMBER }], asnwer_url: ['https://example.com/answer'], }); console.log(call.uuid); ``` ```ts const call = await voiceClient.createOutboundCall({ to: [{ type: 'phone', number: TO_NUMBER }], ncco: [{ action: 'talk', text: 'This is a text to speech call from Vonage' }] }); console.log(call.uuid); ``` -------------------------------- ### Retrieve Specific Call Details (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves detailed information about a single call using its unique identifier (UUID). This provides access to specific call properties like start time. ```ts const call = await voiceClient.getCall('CALL_UUID'); console.log(call.startTime); ``` -------------------------------- ### Retrieve Meeting Room Pages in TypeScript Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves pages of meeting rooms. Examples include fetching a default page and a specific page using pageSize and pageNumber parameters. Logs total items and page size for each response. ```ts const resp = await meetingsClient.getRoomPage(); console.log(`There are ${resp.totalItems} meeting rooms`); console.log(`There are ${resp.pageSize} meeting rooms per page`); ``` ```ts const resp = await meetingsClient.getRoomPage({pageSize: 10, pageNumber: 2}); console.log(`There are ${resp.totalItems} meeting rooms`); console.log(`There are ${resp.pageSize} meeting rooms per page`); ``` -------------------------------- ### Install Vonage Voice SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/voice/README.md Instructions on how to install the Vonage Voice SDK for Node.js using either npm or Yarn package managers. This SDK can be used standalone or as part of the overall `@vonage/server-sdk` package. ```bash npm install @vonage/voice ``` ```bash yarn add @vonage/voice ``` -------------------------------- ### Get Experience Composer Render Details with Vonage Video Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves the details of an Experience Composer render by its ID. This is useful for monitoring the progress or checking the creation timestamp of a specific render. ```ts const render = await videoClient.getExperienceComposerRender(RENDER_ID); console.log(render.createdAt); ``` -------------------------------- ### Vonage Media API Client Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Documentation for the `Media` class, which enables users to manage their media items programmatically via the Media API. This client is only available as a standalone client. ```APIDOC Media Class: Client class to interact with the Media API which enables users to manage their media items programmatically. This client is only available as a standalone client. It cannot be instantiated from the server-sdk package. ``` -------------------------------- ### Retrieve Page of Media Items (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves a paginated list of media items, showing the total count and the number of items on the current page. ```ts const resp = await mediaClient.getMediaPage(); console.log(`There are ${resp.count} media items in total`); console.log(`Showing ${resp._embedded.media.length} media items on this page`); ``` -------------------------------- ### Get Caption Status with Vonage Video Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Retrieves the status of a caption by its ID using the Vonage Video Client. This method allows you to check the current state of a previously initiated captioning process. ```ts const captionStatus = await videoClient.getCaptionStatus(CAPTION_ID); console.log(captionStatus.status); ``` -------------------------------- ### Install Vonage Numbers SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/numbers/README.md Instructions to install the Vonage Numbers SDK using the Node Package Manager (NPM). This command adds the `@vonage/numbers` package to your project dependencies, making it available for use. ```bash npm install @vonage/numbers ``` -------------------------------- ### Retrieve Prefix Pricing Information (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Demonstrates how to retrieve pricing information for a specific prefix and service type using the `pricingClient.listPrefixPricing` method. It shows importing `ServiceType` and logging the default price. ```ts import { ServiceType } from '@vonage/pricing'; const pricing = await pricingClient.listPrefixPricing(ServiceType.SMS, '44'); console.log(`The current price for Great Britian is ${pricing.defaultPrice}`); ``` -------------------------------- ### Install Vonage Node.js SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-sdk/README.md This command installs the Vonage Server SDK for Node.js using Yarn. It adds the @vonage/server-sdk package to your project's dependencies, providing an alternative to NPM for package management. ```bash yarn add @vonage/server-sdk ``` -------------------------------- ### Create Standalone Vonage Video Client Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Initializes a new Video client instance directly, providing API key and secret. This is useful for applications focused solely on video functionalities. ```ts import { Video } from '@vonage/video'; const videoClient = new Video({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); ``` -------------------------------- ### Initialize Vonage Messages SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/messages/v2_TO_v3_MIGRATION_GUIDE.md Shows how to import the `Messages` object when using the `@vonage/messages` module as a standalone package. This setup allows direct use of messaging functionalities without the full server SDK. ```javascript const {Messages} = require('@vonage/messages'); ``` -------------------------------- ### Run tests in watch mode for Vonage Node.js SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-sdk/README.md This command starts the test runner in watch mode, continuously monitoring code changes and re-running tests automatically. It's useful for development to get immediate feedback on code modifications. ```bash npm run test-watch ``` -------------------------------- ### Instantiate Vonage Pricing SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/pricing/README.md Shows how to use the Vonage Pricing SDK independently without the full Vonage Server SDK. It demonstrates instantiating a `Pricing` client directly by requiring `@vonage/pricing` and providing authentication credentials. ```javascript const { Auth } = require('@vonage/auth'); const { Pricing } = require('@vonage/pricing'); const credentials = new Auth({ apiKey: API_KEY, apiSecret: API_SECRET }); const options = {}; const pricingClient = new Pricing(credentials, options); ``` -------------------------------- ### Perform Fraud Score Check with Vonage Number Insight v2 (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md This snippet demonstrates how to use the Vonage Number Insight v2 API to check the fraud risk score for a given phone number. It utilizes the `checkForFraud` method with `Insight.FRAUD_SCORE` to get a risk assessment. ```ts import { Insight } from '@vonage/number-insight-v2'; const score = await client.numberInsightV2.checkForFraud({ type: 'phone', number: '447700900000', insights: [ Insight.FRAUD_SCORE, ], }); console.log(`Fraud score: ${score.riskScore}`); ``` -------------------------------- ### Run Vonage SIM Swap SDK Tests Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/network-sim-swap/README.md Command to execute the test suite for the Vonage SIM Swap SDK using npm. ```bash npm run test ``` -------------------------------- ### Initialize Vonage Verify SDK Standalone Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/verify/v2_TO_v3_MIGRATION_GUIDE.md Shows how to import and initialize the Vonage Verify SDK when used as a standalone module. This approach allows direct use of the Verify functionality without the full Vonage Server SDK. ```js const { Verify } = require('@vonage/verify') ``` -------------------------------- ### Start Vonage Verification Request with PSD2 Parameters Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Initiates a new verification request with additional PSD2 (Payment Services Directive 2) parameters like payee and amount. This is useful for transactions requiring enhanced security and compliance, demonstrating how to include these details and check the request status. ```ts const result = await verifyClient.start({ number: TO_NUMBER, payee: PAYEE, amount: AMOUNT }) if (result.requestId) { console.log(`Request started with id ${result.requestId}`); } else { console.log(`Request failed with error: ${result.errorText}`); } ``` -------------------------------- ### Vonage Number Insights SDK Method Migrations (2.x to 3.x) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/number-insights/v2_TO_v3_MIGRATION_GUIDE.md Documents the changes in method names and signatures for Number Insights lookups between Vonage Node SDK versions 2.x and 3.x, detailing the deprecation of `get()` and the introduction of new synchronous and asynchronous lookup types. ```APIDOC Deprecated 2.x Method: - Method: vonage.numberInsight.get() - Notes: This method has been expanded to individual lookup types, which now take a phone number as a primary parameter and then an object of additional options. New 3.x Methods: - Method: vonage.numberInsights.advancedLookup() Description: Allows a synchronous advanced lookup. Parameters: - phoneNumber: Primary parameter (required) - options: Optional object of additional options - Method: vonage.numberInsights.asyncAdvancedLookup() Description: Allows an asynchronous advanced lookup. Parameters: - phoneNumber: Primary parameter (required) - options: Optional object of additional options - Method: vonage.numberInsights.basicLookup() Description: Allows a synchronous basic lookup. Parameters: - phoneNumber: Primary parameter (required) - options: Optional object of additional options - Method: vonage.numberInsights.standardLookup() Description: Allows a synchronous standard lookup. Parameters: - phoneNumber: Primary parameter (required) - options: Optional object of additional options ``` -------------------------------- ### Configure Vonage Server SDK with Numbers API Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/numbers/v2_TO_v3_MIGRATION_GUIDE.md Demonstrates how to initialize the main Vonage Node Server SDK using an application ID and private key, and then access the numbers API to retrieve phone pricing information. ```js const Vonage = require('@vonage/server-sdk'); const vonage = new Vonage({ applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }); vonage.numbers.getPhonePricing() .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` -------------------------------- ### Initialize Vonage Node.js SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-sdk/README.md This JavaScript snippet demonstrates how to initialize the Vonage SDK. It requires 'credentials' for authentication and optional 'options' for configuration, allowing interaction with Vonage APIs. ```javascript const { Vonage } = require('@vonage/server-sdk'); const vonage = new Vonage(credentials, options); ``` -------------------------------- ### Install Vonage Messages SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/messages/README.md Command to install the Vonage Messages SDK using Yarn. ```bash yarn add @vonage/messages ``` -------------------------------- ### RCSVideo Class API Documentation Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md API documentation for the `RCSVideo` class, which represents a video message for the RCS channel within the Vonage Messages Package. ```APIDOC Class: RCSVideo Description: Represents a video message for the RCS channel. ``` -------------------------------- ### Install Vonage Number Insight V2 SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/number-insight-v2/README.md Alternatively, use this command to install the Vonage Number Insight V2 SDK package via Yarn. This provides the same functionality as npm installation but uses the Yarn package manager. ```bash yarn add @vonage/number-insight-v2 ``` -------------------------------- ### Instantiate standalone Vonage Auth client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Demonstrates how to create an instance of the `Auth` client directly, providing API key, secret, application ID, and private key path for authentication. This client is used for generating authentication headers and query parameters. ```ts import { Auth } from '@vonage/auth'; const auth = new Auth({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET, applicationId: VONAGE_APPLICATION_ID, privateKey: VONAGE_APPLICATION_PRIVATE_KEY_PATH }); ``` -------------------------------- ### Install Vonage SMS SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/sms/README.md Command to install the Vonage SMS SDK package using yarn. ```Bash yarn add @vonage/sms ``` -------------------------------- ### Enable Video Captions Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Enables captions for a video session using a client token. This initiates the display of real-time captions for improved accessibility. ```ts const result = await videoClient.enableCaptions(SESSION_ID, CLIENT_TOKEN); console.log(result.captionId); ``` -------------------------------- ### Install Vonage SMS SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/sms/README.md Command to install the Vonage SMS SDK package using npm. ```Bash npm install @vonage/sms ``` -------------------------------- ### Install Vonage JWT SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/jwt/README.md Installs the Vonage JWT SDK for Node.js using the Yarn package manager. ```bash yarn add @vonage/jwt ``` -------------------------------- ### Initialize Vonage Server Client in Node.js Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md Demonstrates how to create a new Vonage Server Client instance by passing an authentication object. This client is used to interact with Vonage APIs. ```js const { Auth } = require('@vonage/auth'); const { Client } = require('@vonage/server-client'); const vonageClient = new Client (new Auth({ apiKey: API_KEY, apiSecret: API_SECRET, applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }), options, ); ``` -------------------------------- ### Install Vonage JWT SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/jwt/README.md Installs the Vonage JWT SDK for Node.js using the npm package manager. ```bash npm install @vonage/jwt ``` -------------------------------- ### Initialize Vonage Pricing SDK as Standalone Module Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/pricing/v2_TO_v3_MIGRATION_GUIDE.md Shows the simple way to import and initialize the `@vonage/pricing` module when it's used independently, without the full Vonage Server SDK. ```js const { pricing } = require('@vonage/pricing'); ``` -------------------------------- ### Initializing Vonage Video Client with Vonage Server SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/video/OPENTOK_TO_VONAGE_MIGRATION.md Demonstrates how to configure the Vonage Node Server SDK with application credentials (application ID and private key) to access the video client. Once configured, the video client is available as `vonage.video`, allowing for operations like session creation. ```js const Vonage = require('@vonage/server-sdk'); const vonage = new Vonage({ applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }); const session = await vonage.video.createSession(); ``` -------------------------------- ### Install Vonage Messages SDK with NPM Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/messages/README.md Command to install the Vonage Messages SDK using the Node Package Manager (NPM). ```bash npm install @vonage/messages ``` -------------------------------- ### List Experience Composer Renders with Vonage Video Client (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Lists Experience Composer renders based on specified filter criteria. This method helps in retrieving a collection of renders, allowing iteration through their details. ```ts const renders = await videoClient.listExperienceComposerRenders(); for (const render of renders.items) { console.log(render.id); } ``` -------------------------------- ### Configure Vonage Node SDK with Number Insights Client Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/number-insights/v2_TO_v3_MIGRATION_GUIDE.md Demonstrates how to initialize the main Vonage Node Server SDK with application credentials and access the Number Insights client for a basic lookup, noting the change in accessor from `numberInsight` to `numberInsights`. ```javascript const Vonage = require('@vonage/server-sdk'); const vonage = new Vonage({ applicationId: APP_ID, privateKey: PRIVATE_KEY_PATH, }); vonage.numberInsights.basicLookup(PHONE_NUMBER) .then(resp => console.log(resp)) .catch(err => console.error(err)); ``` -------------------------------- ### Retrieve a Theme by ID (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Fetches a specific theme using its unique theme ID. Logs the theme's name and ID upon retrieval. ```ts const theme = await meetingsClient.getTheme('my-theme-id'); console.log(`Theme ${theme.themeName} has ID ${theme.id}`); ``` -------------------------------- ### Update an Existing Conversation (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Updates an existing conversation with new details such as its name. This example shows how to modify a conversation identified by conversation_ID. ```ts const conversation = await conversationClient.updateConversation({ id: conversation_ID, name: 'My Conversation' }); console.log(conversation.name); ``` -------------------------------- ### Vonage Meetings API Client Reference Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Comprehensive API documentation for the Vonage Meetings client class and its methods, covering room and theme management, recording operations, and data retrieval. ```APIDOC Meetings Class: Description: Client class to interact with the Meetings API to create and manage meeting rooms. Availability: Standalone client only, cannot be instantiated from the server-sdk package. Constructor: __init__(options: object) options: object - Configuration options for the client. apiKey: string - Your Vonage API Key. apiSecret: string - Your Vonage API Secret. applicationId: string - Your Vonage Application ID. privateKey: string - Path to your Vonage Application Private Key. ``` ```APIDOC createRoom(roomDetails: object): Promise Description: Creates a new meeting room. Parameters: roomDetails: object - Details for the new room. displayName: string - The display name for the room. metadata: object (optional) - Custom metadata for the room. Returns: Promise - A promise that resolves to the created room object. ``` ```APIDOC createTheme(themeDetails: object): Promise Description: Creates a new theme with the provided theme details. Parameters: themeDetails: object - Details for the new theme. themeName: string - The name of the theme. mainColor: string - The main color in hex format (e.g., '#C0FFEE'). brandText: string - The brand text. shortCompanyUrl: string - The short company URL. Returns: Promise - A promise that resolves to the created theme object. ``` ```APIDOC deleteRecording(recordingId: string): Promise Description: Deletes a recording by its ID. Parameters: recordingId: string - The ID of the recording to delete. Returns: Promise - A promise that resolves when the recording is deleted. ``` ```APIDOC deleteTheme(themeId: string): Promise Description: Deletes a theme by its theme ID. Parameters: themeId: string - The ID of the theme to delete. Returns: Promise - A promise that resolves when the theme is deleted. ``` ```APIDOC getDialInNumbers(): AsyncIterable Description: Retrieves a list of dial-in numbers. Returns: AsyncIterable - An async iterable of dial-in number objects. ``` ```APIDOC getRecording(recordingId: string): Promise Description: Retrieves a recording by its ID. Parameters: recordingId: string - The ID of the recording to retrieve. Returns: Promise - A promise that resolves to the recording object. ``` ```APIDOC getRoom(roomId: string): Promise Description: Retrieves a meeting room by its ID. Parameters: roomId: string - The ID of the room to retrieve. Returns: Promise - A promise that resolves to the room object. ``` ```APIDOC getRoomPage(options?: object): Promise Description: Retrieves a page of meeting rooms based on the provided parameters. Parameters: options: object (optional) - Pagination options. pageSize: number (optional) - The number of items per page (default: 10). pageNumber: number (optional) - The page number to retrieve (default: 1). Returns: Promise - A promise that resolves to a page object containing meeting rooms and pagination info. ``` ```APIDOC getRooms(): AsyncIterable Description: Retrieves a list of meeting rooms until there are no more pages. Returns: AsyncIterable - An async iterable of room objects. ``` ```APIDOC getRoomsForTheme(themeId: string): AsyncIterable Description: Retrieves a list of meeting rooms associated with a specific theme, handling pagination automatically. Parameters: themeId: string - The ID of the theme. Returns: AsyncIterable - An async iterable of room objects associated with the theme. ``` ```APIDOC getRoomsForThemePage(themeId: string, options?: object): Promise Description: Retrieves a page of meeting rooms associated with a specific theme. Parameters: themeId: string - The ID of the theme. options: object (optional) - Pagination options. pageSize: number (optional) - The number of items per page (default: 10). pageNumber: number (optional) - The page number to retrieve (default: 1). Returns: Promise - A promise that resolves to a page object containing meeting rooms for the theme and pagination info. ``` -------------------------------- ### Install Vonage Redact SDK with Yarn Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/redact/README.md Instructions for installing the Vonage Redact SDK using Yarn. This package provides access to the Redact API. ```bash yarn add @vonage/redact ``` -------------------------------- ### Update an Existing Application (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Updates an existing Vonage application with new details such as its name. This example shows how to modify an application identified by APPLICATION_ID. ```ts const application = await applicationClient.updateApplication({ id: APPLICATION_ID, name: 'My Application' }); console.log(application.name); ``` -------------------------------- ### Delete an Application by ID (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Deletes an existing Vonage application using its unique identifier. This example shows a simple call to remove an application. ```ts await applicationClient.deleteApplication(APPLICATION_ID); ``` -------------------------------- ### Instantiate Standalone Vonage Applications Client Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/applications/README.md Shows how to create a standalone Applications client by requiring `@vonage/auth` and `@vonage/applications`, providing credentials and optional configurations. ```javascript const { Auth } = require('@vonage/auth'); const { Applications } = require('@vonage/applications'); const credentials = new Auth({ apiKey: API_KEY, apiSecret: API_SECRET, }); const options = { timeout: 1500 }; const applicationsClient = new Applications(credentials, options); ``` -------------------------------- ### Run tests for Vonage Pricing SDK Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/packages/pricing/README.md Command to execute the test suite for the Vonage Pricing SDK. This command typically runs all defined tests within the project. ```bash npm run test ``` -------------------------------- ### Instantiate Vonage Number Insights Client from Vonage SDK (TypeScript) Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Shows how to obtain a `NumberInsights` client instance from an existing `Vonage` client, simplifying integration within a larger application. ```ts import { Vonage } from '@vonage/server-client'; const vonage = new Vonage({ apiKey: VONAGE_API_KEY, apiSecret: VONAGE_API_SECRET }); const numberInsightClient = vonage.numberInsight; ``` -------------------------------- ### Create a New Meeting Theme in TypeScript Source: https://github.com/vonage/vonage-node-sdk/blob/3.x/EXAMPLES.md Creates a new theme with specified name, main color, brand text, and short company URL using the Meetings client. Logs the ID of the created theme. ```ts const theme = await meetingsClient.createTheme({ themeName: 'My Theme', mainColor: '#C0FFEE', brandText: 'My Brand', shortCompanyUrl: 'my-brand' }); console.log(`Created theme with ID ${theme.id}`); ```