The Logger SDK allows you to log any custom operation to Helicone - database queries, API calls, ML inference, file processing, or any other operation you want to track.
To get started, install the @helicone/helpers package
Set up your Helicone API key in your .env file
Log into Helicone or create an account. Once you have an account, you can generate an API key here.
Create a new HeliconeManualLogger instance
Log your request
The logRequest method takes three parameters:
- Request data: What you're logging (query, operation name, etc.)
- Operation function: The actual work being done
- Headers: Optional custom properties or session tracking
Verify your requests in Helicone
With the above setup, any calls to any data operation will automatically be logged and monitored by Helicone. Review them in your Helicone dashboard.
Understanding the Structure#
All custom logs follow the same pattern with two parts:
Request Data#
What you're about to do. Must include:
_type: "data"- Identifies this as a custom data logname- A descriptive name for your operation- Any custom fields you want to track (query, endpoint, model, etc.)
Response Data#
What happened. Should include:
_type: "data"- Identifies this as a custom data responsename- Same name as the requeststatus- Success or error state- Any result data you want to track
More Examples#
API Call#
ML Model Inference#
For more examples, check out our GitHub examples.
To learn more about the
HeliconeManualLogger API, see the API Reference here.