Skip to content

feat(schema): restructure log output format to match proto schema #143

Description

@brucearctor

Summary

Change the default JSON wire format to align with the proto schema structure. This is the primary breaking change in v3.0.0.

Current Format (v2.x — flat)

{
  "target": "button#submit",
  "pageUrl": "https://example.com",
  "userAgent": "Mozilla/5.0...",
  "clientTime": 1720800000000,
  "type": "click",
  "logType": "raw",
  "userId": "user123",
  "sessionId": "sess-abc",
  "attributes": { "data-count": 5 }
}

New Format (v3.0 — proto-aligned)

{
  "metadata": {
    "pageUrl": "https://example.com",
    "userAgent": "Mozilla/5.0...",
    "clientTime": 1720800000000,
    "userId": "user123",
    "sessionId": "sess-abc",
    "screenResolution": { "width": 1920, "height": 1080 }
  },
  "target": "button#submit",
  "eventType": "click",
  "userAction": true,
  "attributes": { "data-count": "5" }
}

Key Changes

  • Shared fields grouped under metadata object
  • typeeventType
  • scrnResscreenResolution (inside metadata)
  • attributes values are always strings (no JSON.parse)
  • logType field moves to envelope level

Depends On

Metadata

Metadata

Assignees

No one assigned

    Labels

    UseralePull requests that update Userale codeenhancement

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions