EdithProDOCS
SDK v1.0.5 ▾Dashboard
SDK/FRAMEWORKS

JavaScript

Use the core @edithpro/sdk class with any framework, or none.

On this page
recorder.js
import { EdithPro } from '@edithpro/sdk'; const ep = new EdithPro({  clientId: 'ep_live_abc123',  workspaceId: 'ws_64f2a1b3',  onReady: () => (button.disabled = false),  onStop: (id, seconds) => console.log('Saved', id, seconds),}); ep.init(); // safe to call more than once const button = document.querySelector('#record');button.addEventListener('click', () => ep.open());

You don’t have to wait for init() before calling open(). The popup waits until the SDK is ready.

Clean up #

recorder.js
// When the page or component goes awayep.destroy(); // removes the popup and all SDK elements

Script tag (no bundler) #

index.html
<!-- React and ReactDOM must be loaded first --><script src="https://cdn.edithpro.app/sdk/latest/index.iife.js"></script><script>  const ep = new EdithProSDK.EdithPro({    clientId: 'ep_live_abc123',    workspaceId: 'ws_64f2a1b3',  });  ep.init();</script>
The script build exposes EdithProSDK, and it expects React, ReactDOM and ReactJSXRuntime on the page. [CONFIRM THE CDN URL AND THE SCRIPTS TO LOAD FIRST]
Was this page helpful? @edithpro/sdk 1.0.5 · Edit this page