Installation
Configuration
Add your credentials to.env:
| Variable | Required | Description |
|---|---|---|
GETIMMUTABLE_API_KEY | Yes | Your imk_ prefixed API key |
GETIMMUTABLE_BASE_URL | Yes | Base domain URL |
GETIMMUTABLE_ASYNC | No | Set true to dispatch tracking via Laravel queues |
Service Provider
The package auto-discoversGetImmutable\GetImmutableServiceProvider. No manual registration needed.
Facade
Tracking Events
Basic Usage
Fluent Builder
PendingEvent Methods
| Method | Parameters | Description |
|---|---|---|
idempotencyKey($key) | string | Set deduplication key |
version($v) | int | Set event schema version |
session($id) | string | Set session identifier |
actionCategory($cat) | string | Set action category |
target($type, $id?, $name?) | string, string?, string? | Add a single target |
targets($arr) | array | Set all targets at once |
track($action, $resource?, $metadata?) | string, string?, array? | Send the event |
Batch Ingestion
Querying Events
Retrieving a Single Event
Verification
Viewer Tokens
Alerts
Exports
Auto-Session Tracking
The Laravel SDK can automatically attach the current Laravel session ID to every tracked event. Enable this in your configuration:Eloquent Observer Example
Track model events automatically using an Eloquent observer:AppServiceProvider:
Queue Integration
SetGETIMMUTABLE_ASYNC=true in your .env to dispatch tracking calls via Laravel’s queue system instead of making synchronous HTTP requests. This prevents audit logging from blocking your application’s response time.