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
| Parameter | Type | Description |
|---|---|---|
scope | string | An arbitrary identifier, up to 128 bytes, that groups Events in your system (for example a tenant ID). |
Sample Response
| Field | Type | Description |
|---|---|---|
id | string | The session ID. |
key | string | Secret used to authenticate as this session. |
scope | string | The scope the session can read. |
expiration_date | string | UTC ISO-8601 time when the session becomes invalid. |
created_date | string | UTC ISO-8601 time when the session was created. |
updated_date | string | UTC ISO-8601 time when the session was last updated. |
team_id | string | The Edlink team that owns the session. |
application_id | string | The 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);
