For Developers

Audit Sessions

Audit Logs are currently in beta and therefore subject to change.

This method authenticates with your application secret. edlink.meta uses the client_secret from the SDK constructor. You can also pass an application token set to edlink.use.

Create the session on your server. Never put the application secret in client-side code.

Create Session

audit_sessions.create(scope);

Create a short-lived audit log session for a scope. The session expires one hour after it is created.

scope is the same string you pass when recording Events. Anyone who receives id and key can read every Event under that scope for your application.

Pass id and key to the Audit Logs widget as session_id and session_key.

Arguments

ParameterTypeDescription
scopestringAn arbitrary identifier, up to 128 bytes, that groups Events in your system (for example a tenant ID).

Sample Response

FieldTypeDescription
idstringThe session ID.
keystringSecret used to authenticate as this session.
scopestringThe scope the session can read.
expiration_datestringUTC ISO-8601 time when the session becomes invalid.
created_datestringUTC ISO-8601 time when the session was created.
updated_datestringUTC ISO-8601 time when the session was last updated.
team_idstringThe Edlink team that owns the session.
application_idstringThe Edlink application that created the session.

Example Usage

const session = await edlink.meta.audit_sessions.create('acme-tenant-7f3a');

// Return session.id and session.key to your frontend.
console.log(session.expiration_date);