Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Web SDK

Open Birdie recorder from a specific button, link or element in your web app!

Get creative! Below is an example of how DropContact use Birdie Web SDK

Birdie Web SDK

1. Install Birdie Web SDK

Using a framework? Go to install with npm

Go to Settings → Integrations and scroll down to the Web SDK item, copy the snippet, and paste it before closing the </body> tag.

You webSDK snippet will look like the example below, all parameters are optional, but the more you can add the more context you will get 👌

Tip: you can add more than one tag by separating them with a comma, e.g. tag: "bug,frontpage,signup" will add 3 different tags to your video: bug, frontpage, and signup.

Install with npm

Available from @birdie-so/snippet@1.3.1

If your app already uses @birdie-so/snippet, or you prefer a package over a script tag, the launcher is one option away:

launcher: true loads the Web SDK next to the snippet. Without it, nothing launcher-related is loaded. On phones and tablets nothing is loaded at all, and birdie.launcher.open() emits an error event instead.

2. Create a custom launcher

Simply add the classname birdieWebsdk_open to one or multiple elements you want to use as a launcher, see 2 examples below:

The recorder opens in its own window the moment the element is clicked. While it is open, Safari shows a small ‘Recorder open’ chip at the bottom right of your page to bring the window back; other browsers show Birdie’s floating recording controls instead.

3. Set the contact email when you know it

Birdie reads the contact at the moment the visitor clicks your launcher, not when the page loads. If the email is typed into a form or is known later, pass it to Birdie as soon as you have it, for example on the field's change event. The last value set before the click is the one the recording is raised under.

Update the settings object. This is safe at any time, even before the Birdie script has loaded.

You can pass a name and an id in the same object.

Call updateBirdie from @birdie-so/snippet.

You can pass a name and an id in the same object.

Handling the widget with Javascript

In some situations, you may prefer to use Javascript to control the widget opening. We provide a few methods for you to use:

• To check the widget status: window.birdie.launcher.opened() will return a boolean.

• To open the recorder: window.birdie.launcher.open() opens the recorder window if it is not already open.

• To close the recorder: window.birdie.launcher.close() closes the recorder window; closeRecorder() is the same call under the name the npm package types use.

• To toggle open/close automatically: window.birdie.launcher.toggle().

For example:

open() opens a browser window, so call it from a user action such as a click handler. Called from a timer or on page load, the browser blocks it and Birdie emits an error event with popup_blocked.

Listening for events

You can hook into 5 different events:

onRecorderOpened onRecorderClosed onRecordingStarted onRecordingStopped onRecordingPosted You must register them from the birdieSettings object, as shown into the example below.

With the npm package, the same five events are available through birdie.on(): recorderOpen, recordingSent, start, stop and recorderClose; recordingSent receives { link }.

React code example

Install the package once:

Then initialize Birdie where your app knows the current user, and open the recorder from any button:

Notes:

  • initBirdie() is safe to call more than once: scripts are injected a single time.

  • getBirdieInstance() returns null until Birdie is ready, so the optional chaining above is enough; no device check is needed, on phones and tablets the package provides an inert launcher and emits an error event instead of opening anything.

  • Call launcher.open() from a click handler, as here. Called from a timer or on mount, the browser blocks the recorder window.

  • Already loading the snippet with initBirdie() elsewhere in your app? Add launcher: true to that call instead of calling it again here.

Example: Add Birdie to a custom ticket form using the Web SDK

A common use case involves using the Web SDK to integrate Birdie into a custom ticket form. While you're free to get creative, here are three different ways Birdie could be added to the Active Campaign ticket form:

Option 1: Use an existing field

Option 1 - A Birdie button has been added in the existing Description field
Option 1 - The video link is automatically added to the Description text box

Option 2: Create a new field

Option 2 - A Birdie button has been added to a new field that display a visible text box for the video URL
Option 2 - The video link is automatically added to the field in a visible text box

Option 3: Create a new hidden field

Option 3 - A Birdie button has been added to a new field. There is no visible text box for the video URL
The video URL is not visible. The UI of the Birdie button has changed.

It exists many more options... Your turn now.

Last updated