The Node.js SDK is continually evolving, with new endpoints being added for notifications, events, and more. Stay tuned for updates!

Overview

The Roark Node.js SDK provides a streamlined way to interact with the Roark API. This guide will help you quickly set up the SDK and start analyzing call recordings in your application.

Prerequisites

Before you begin, ensure you have:

Installation

Choose your preferred package manager:

npm install @roarkanalytics/sdk

Quick Start

1

Import the SDK

import Roark from '@roarkanalytics/sdk';
2

Initialize the Client

const client = new Roark({
  bearerToken: 'YOUR_ROARK_API_KEY'
});

Replace YOUR_ROARK_API_KEY with your actual API key from Roark.

3

Post a Call Recording

const response = await client.callAnalytics.create({
  startedAt: new Date().toISOString(),
  callDirection: 'INBOUND',
  interfaceType: 'PHONE',
  participants: [
    { role: 'AGENT', spokeFirst: true, name: 'John Doe', phoneNumber: '123456789' },
    { role: 'CUSTOMER', name: 'Jane Doe', phoneNumber: '123456789' },
  ],
  recordingUrl: 'https://example.com/recording.wav',
});

console.log('Call Recording Posted:', response.data);
4

You're All Set

That’s it! You can now use the SDK to post call recordings to Roark and analyze them in real-time.

Additional Resources