SessionKit DOCS
Get Started
API Reference Session Updates
subscriptiononSessionUpdate

onSessionUpdate

Subscribe to real-time updates for a session. Receives events when session status changes, pages navigate, or errors occur.

The session ID to watch. Filter which event types to receive. Omit for all events.

Subscription

subscription OnSessionUpdate($sessionId: ID!, $events: [SessionEventType!]) {
  sessionUpdate(sessionId: $sessionId, events: $events) {
    type
    timestamp
    ... on NavigationEvent {
      url
      status
      loadTime
    }
    ... on StatusEvent {
      previousStatus
      newStatus
    }
    ... on ErrorEvent {
      code
      message
    }
  }
}

Variables

{
  "sessionId": "ses_k8m2n4p6",
  "events": ["NAVIGATION", "STATUS_CHANGE", "ERROR"]
}

Response Stream

{
  "data": {
    "sessionUpdate": {
      "type": "NAVIGATION",
      "timestamp": "2026-06-23T15:01:23Z",
      "url": "https://example.com",
      "status": 200,
      "loadTime": 1234
    }
  }
}
{
  "data": {
    "sessionUpdate": {
      "type": "STATUS_CHANGE",
      "timestamp": "2026-06-23T15:30:00Z",
      "previousStatus": "active",
      "newStatus": "expired"
    }
  }
}
⌘I
AI Assistant

Ask me anything about the documentation.

ESC