For Developers

Audit Logs Widget

Audit Logs are currently in beta please report any issues and be mindful that the API is new!

The audit logs widget embeds a searchable activity browser into your product. Your users can filter and search Events in your platform by actor, action, target, and more; browse a histogram over a date range; and open a detail drawer for a single Event.

It is designed for embedding in your own dashboard so districts (or your organization) can review activity without needing the Edlink dashboard.

How authentication works

Unlike widgets that use a person's email or an integration token, the audit logs widget uses a two-part credential:

  1. Your application's publishable key (pk_...) — safe to expose in the browser.
  2. A short-lived audit log session — created on your server with your application secret, then passed into the widget as session_id + session_key.

Session creation must happen on your backend. Never put your application secret in client-side code.

The widget calls session-scoped APIs with these credentials so the user only see events in the scope you provided.

Choose your scope intentionally and be careful who's browser you send the credentials to. Any events with a matching scope from your application will be visible to these credentials

Usage

1. Installation

Add the Widgets SDK script to your website:

<script src="https://ed.link/widgets/edlink@1.0.0.js"></script>

2. Create an audit log session (server-side)

Before mounting the widget, create a session for the scope you want the user to see. Sessions default to expiring in one hour.

const response = await fetch("https://ed.link/api/v2/audit/sessions", {
    method: "POST",
    headers: {
        Authorization: `Bearer ${applicationSecret}`,
        "Content-Type": "application/json",
    },
    body: JSON.stringify({
        scope: "your-custom-scope",
    }),
});

const data = await response.json();

Example response shape:

{
    "$data": {
        "id": "00000000-0000-0000-0000-000000000000",
        "key": "…",
        "scope": "your-custom-scope",
        "expiration_date": "2026-08-07T16:00:00.000Z"
    }
}

Return id and key to your frontend for the next step. Use expiration_date to monitor if you need a new session. Optionally pass expiration_date in the request body if you need a different lifetime (maximum 24 hours from now).

scope should match the scope you use when recording Events. The session only grants read access to Events under that scope for your application.

3. Initialization

Initialize the SDK with your application ID and publishable key.

const edlink = new Edlink({
    client_id: '00000000-0000-0000-0000-000000000000',
    publishable_key: 'pk_...',
    colors: {
        // Prefer a Tailwind palette name (see Customizing the appearance)
        primary: 'blue'
    }
});

Create a widget instance attached to a root element:

const widget = edlink.createWidget({
    root: document.getElementById('edlink-widget-root')
});

4. Activation

Activate the browse plugin with the session credentials from your server:

widget.activatePlugin({
    name: 'audit_logs_browse',
    options: {
        session_id: session.id,
        session_key: session.key
    }
});

The widget appears automatically because it is attached to a root element. No need to call show().

We suggest giving the root element a defined height (for example height: 100% on a flex child). The browse widget fills its iframe. When a user opens an Event, a fullscreen overlay mounts outside of this root to display a drawer.

Configuration Options

OptionTypeDescription
session_idStringRequired. UUID of the audit log session created on your server.
session_keyStringRequired. Secret key returned when the session was created. Treat like a password for the lifetime of the session.

Events

No specific events for this plugin.