Get started
This guide will show you how to install and mount the recorder.
Installation
There are multiple ways to install the recorder depending on your project.
- npm
- CDN
npm install @pathfindr.dev/recorder
<script src="https://unpkg.com/@pathfindr.dev/recorder"></script>
<link rel="stylesheet" href="https://unpkg.com/@pathfindr.dev/recorder/dist/recorder.css">
Create container
Add an empty <div>
element with a specified height and width, and an id. This is where the recorder will be mounted.
<div id="recorder-container" style="height: 200px; width: 250px"></div>
Initialization
Initialize the recorder by giving it the options object.
- npm
- CDN
import Recorder from '@pathfindr.dev/recorder';
import '@pathfindr.dev/recorder/dist/recorder.css';
const element = document.getElementById('recorder-container');
const options = {
recorderType: 'camera',
accessToken: 'documenta-tion-toke-n935-27ee26170781',
language: 'en',
};
const recorder = new Recorder(element, options);
const element = document.getElementById('recorder-container');
const options = {
recorderType: 'camera',
accessToken: 'documenta-tion-toke-n935-27ee26170781',
language: 'en',
};
const recorder = new Pathfindr.Recorder(element, options);