The Node.js SDK is continually evolving, with new endpoints being added regularly. Stay tuned for updates!
Overview
The Roark Node.js SDK provides a streamlined way to interact with the Roark API. This guide covers the two most common workflows: uploading calls and running metrics, and executing simulation run plans.Prerequisites
Before you begin, ensure you have:- Node.js v12 or higher - Download Node.js
- A Roark API Key - Generate one here
Installation
Choose your preferred package manager:Initialize the Client
Set
ROARK_API_BEARER_TOKEN in your environment, or replace with your actual API key from Roark.Upload a Call and Run Metrics
Upload a call recording, then run metric definitions against it using a collection job.1
Upload a Call
2
Get Metric Definitions
List available metric definitions to choose which ones to run:
3
Create a Metric Collection Job
Run the selected metrics against your uploaded call:
4
Poll for Completion
5
Fetch Results
Run a Simulation Run Plan
Create and execute a simulation run plan to systematically test your voice AI agent.1
Create the Run Plan
Define scenarios, personas, agent endpoints, and metrics to include:
2
Or Start an Existing Plan
If you already have a run plan, start a new job for it:
3
Monitor Progress
4
View Results
Results including metric evaluations are available in the Roark dashboard, or you can fetch metrics for individual simulation calls via the API:
Additional Examples
Create a call with tool invocations
Create a call with tool invocations
Track function calls and tool usage during the conversation:
Create a call with an existing agent
Create a call with an existing agent
Reference an agent by its Roark ID or custom ID:
Create a metric collection job for multiple calls
Create a metric collection job for multiple calls
Run metrics across a batch of existing calls:
Additional Resources
API Reference
Explore our comprehensive API documentation
Example Repository
View example implementations and use cases
NPM Package
View package details and stats on npm
GitHub Repository
Browse the source code and contribute