Appearance
Setup
Add the Capture Web SDK to your website by adding the following code snippet to the <head> section of your page.
INFO
Replace "YOUR_CAPTURE_KEY" with the capture key from your team settings page.
html
<script>
window.captureOptions = {
captureKey: "YOUR_CAPTURE_KEY",
};
</script>
<script
src="https://cdn.capture.dev/capture-js/browser/latest.js"
async
></script>Configuration
Set options on window.captureOptions before the SDK script loads to configure how Capture works on your page.
| Option | Type | Required | Description |
|---|---|---|---|
captureKey | string | Yes | Your team's capture key. Routes captures to your team and applies its default destinations. |
identity | object | null | No | The user to attribute captures to. See Identifying users. |
context | object | No | Key-value data to attach to every capture, such as app version or feature flags. See Custom context. |
transform | function | No | Mask, redact or drop network requests and console logs before they are recorded. See Data transform. |
js
window.captureOptions = {
captureKey: "YOUR_CAPTURE_KEY",
identity: { identifier: "user-123", email: "jane@example.com" },
context: { appVersion: "2.4.1" },
transform: (signal) => signal,
};Once the SDK has loaded, a global Capture object is available for changing these at runtime.
| Method | Description |
|---|---|
Capture.identify(identity) | Set the current user, or pass null to clear it. See Identifying users. |
Capture.setCustomContext(values) | Merge values into the custom context. |
Capture.unsetCustomContext(key) | Remove a single key from the custom context. |
Capture.open() | Open the toolbar. See Triggers. |
Web embed
With the Web SDK installed, visitors can create captures from your site without installing the browser extension.
Test it by opening the toolbar with the keyboard shortcut:
- Windows:
Ctrl + Alt + 1 - Mac:
Cmd + Option + 1
If the toolbar does not appear, check the browser console for errors or see the troubleshooting guide.
Next steps
The toolbar opens with a keyboard shortcut by default. You can set custom triggers to customise this behaviour.