API Reference
Error Monitoring
Getting Started
Welcome to Highlight
Integrations
Product Features
Session Replay
Tips
Menu

H.parseHeaders()

parseHeaders: ( headers: IncomingHttpHeaders, ) => { secureSessionId: string; requestId: string } | undefined
Copy
Purpose

H.parseHeaders() is a helper function for extracting the Highlight secureSessionId and requestId from network requests. These fields are sent with network requests as the 'x-highlight-request' header, encoded as a slash-separated string: "{secureSessionId}/{requestId}"

Example Usage
import * as http from 'http' import { H } from '@highlight-run/node' const onError = (request: http.IncomingMessage, error: Error): void => { const parsed = H.parseHeaders(request.headers) if (parsed !== undefined) { H.consumeError(error, parsed.secureSessionId, parsed.requestId) } }
Copy
Arguments

headers : IncomingHttpHeaders

  • The headers sent as part of your network request.