This backend SDK requires one of the Highlight frontend SDKs to be installed, so please make sure you've followed the fullstack mapping guide first.
Install @highlight-run/cloudflare with your package manager.
Use the Cloudflare Worker SDK in your response handler. The
sendResponse method traces successful requests while
consumeError reports exceptions. All Highlight data submission uses waitUntil to make sure that we have no impact on request handling performance.
You'll want to throw an exception in one of your cloudflare handlers. Access the API handler and make sure the error shows up in Highlight.
Using our library requires setting skipLibCheck because of one of our dependencies that references node types. At runtime, this does not cause issues because of dynamic imports and other polyfilling done to ensure the sdk works in the cloud flare worker runtime, but the types are still referenced.
With the JS SDKs, your logs are reported automatically from console methods. See the JS logging setup guide for more details.