Skip to content
midgeDocs
ShareWebsite SDK
Share

Website SDK

Add a Report a bug button to your own app: customers record the tab, and the report arrives with its console, network, actions and your metadata.

The Midge SDK puts a recording link inside your own website or web app. A customer clicks Report a bug, records the tab they’re on, watches it back and sends it. The report reaches your workspace with what the page did while they recorded: console messages and errors, network requests, clicks and page changes. It also carries the context you add yourself, such as the user’s ID, their plan or the feature flags that were on.

Everything is redacted in the customer’s browser before it’s sent, with the same rules as the Chrome extension: passwords, tokens, cookies, card numbers and the like never leave it. See what redaction removes.

Set it up

  1. Make a recording link. Open Settings › Workspace › Recording links on midge.dev and create one. The SDK sends to it, so its title is what customers see on the panel (“Report a bug to Acme”).

  2. Verify your domain. In the Website SDK card, an owner or admin adds the domain your app runs on, such as app.example.com. Prove it’s yours in one of two ways, then click Verify:

    • a DNS TXT record on _midge.app.example.com (or on the domain itself) with the value Midge shows, midge-verify=…, or
    • a file at https://app.example.com/.well-known/midge-verify.txt that contains the code.

    Or click Auto configure: Midge sends you to your DNS provider (Cloudflare, for example), which shows the one record Midge wants to add; you click to approve it and come back verified. With Domain Connect, the provider adds the record itself and Midge never gets access to your account. Where your provider doesn’t support it, Manual setup shows the record to copy.

    A verified domain covers its subdomains too. The SDK sends nothing from a domain that isn’t verified: it shows a short note instead, so nobody can put your link on another site.

  3. Add the script. Copy the snippet from the same card and paste it before </body>:

html
<script src="https://midge.dev/sdk/v1.js" data-link="YOUR_LINK_TOKEN" async></script>

A Report a bug button appears in the bottom right corner. The script is about 14 KB compressed and loads without blocking your page.

Add context with metadata

Midge.metadata() adds values that appear on the report, under From the site in the Info tab. Call it whenever they change; values merge, and null removes one.

js
Midge.metadata({ userId: 'u_42', plan: 'pro', flags: { newCheckout: true } });

To set them before the script loads, use window.MidgeSettings:

html
<script>window.MidgeSettings = { metadata: { userId: 'u_42' } };</script>
<script src="https://midge.dev/sdk/v1.js" data-link="YOUR_LINK_TOKEN" async></script>

Metadata goes through redaction too, and is limited to 20 KB. If someone on your team reports a bug on your site with the Midge Chrome extension, their report includes the metadata as well.

Hide parts of the page

While a customer records, Midge blurs password fields and any element with the data-midge-blur attribute:

html
<div class="card-number" data-midge-blur>4242 4242 4242 4242</div>

For elements you can’t change, list CSS selectors in data-blur="…" on the script tag, or call Midge.blur(['.ssn', '#iban']). The blur is applied to the page itself, so it’s in the video; it’s removed when the recording stops.

Your own button

Leave the floating button out with data-button="false" and open the recorder from anywhere in your app:

js
document.querySelector('#help-report').addEventListener('click', () => Midge.open());

Midge.hideButton() and Midge.showButton() switch the floating button at runtime. The midge:ready event on window fires when Midge is available.

What your customer sees

The panel shows your workspace name and the link’s title. Start recording asks the browser to share this tab; Record my voice too adds their microphone. A small bar with a timer and Stop stays at the bottom while they record. Afterwards they can watch the video, add their name, email and a description, and send it. Recordings can be up to 15 minutes long, in Chrome, Edge, Firefox and Safari on a computer.

What you get

The report appears in your workspace like any recording from a link, marked as sent from the website SDK, with the page it was sent from. Its console, network and actions line up with the video, the AI summary uses them, and Slack, Linear, Jira, GitHub and webhooks work as usual.

Content Security Policy

If your site sets a Content Security Policy, allow Midge:

script-src https://midge.dev
connect-src https://midge.dev
media-src blob:

Limits

The recording link limits apply: 50 recordings per link per day, and a limit per visitor. Instead of the bot check on the link page, the SDK depends on the verified domain. A workspace can verify up to 20 domains.