JS SDK Reference
Installation
Section titled “Installation”<script src="https://embed.nouncify.com/embed.js"></script>The SDK is loaded from embed.nouncify.com and creates a global Nouncify object.
Nouncify.openRecorder(options)
Section titled “Nouncify.openRecorder(options)”Opens a centered popup modal with the recording interface.
Nouncify.openRecorder({ token: 'emb_tk_...', // Required: embed token onSuccess: (result) => {}, // Called on successful recording onCancel: () => {}, // Called on popup close without recording onError: (error) => {}, // Called on error});Options
Section titled “Options”| Option | Type | Required | Description |
|---|---|---|---|
token | string | ✅ | Embed token from POST /v1/embed/token |
onSuccess | function | Callback with {play_link, recording_id} | |
onCancel | function | Called when user closes without recording | |
onError | function | Called with error object |
Success result
Section titled “Success result”{ play_link: 'https://api.nouncify.com/p/HkJ3mN8x', recording_id: 'recording-uuid'}Nouncify.mountRecorder(selector, options)
Section titled “Nouncify.mountRecorder(selector, options)”Mounts the recorder as an inline iframe inside a container element.
Nouncify.mountRecorder('#my-container', { token: 'emb_tk_...', onSuccess: (result) => {}, onError: (error) => {},});Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
selector | string | CSS selector for the container element |
options | object | Same as openRecorder options (except onCancel) |
The iframe will fill the container’s width. Recommended minimum height: 300px.
Framework examples
Section titled “Framework examples”import { useEffect, useRef } from 'react';
function NameRecorder({ token }) { const containerRef = useRef(null);
useEffect(() => { if (window.Nouncify && containerRef.current) { window.Nouncify.mountRecorder(containerRef.current, { token, onSuccess: (result) => { console.log('Play link:', result.play_link); }, }); } }, [token]);
return <div ref={containerRef} style={{ minHeight: 300 }} />;}<template> <div ref="recorder" style="min-height: 300px" /></template>
<script setup>import { onMounted, ref } from 'vue';
const props = defineProps(['token']);const recorder = ref(null);
onMounted(() => { window.Nouncify.mountRecorder(recorder.value, { token: props.token, onSuccess: (result) => console.log(result.play_link), });});</script>