Apr 30, 2025
Insights API client
The Insights API client is part of the @algolia/client-insights package.
To install this package, run:
Copy
1
npm install @algolia/client-insights
To use this client, run:
Copy
1
2
3
import { insightsClient } from "@algolia/client-insights";
const client = insightsClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
To send events from your front- or backend,
consider using the search-insights library instead.
It comes with many helper methods for sending specific event types
and managing the user token.
List of methods
Each method makes one request to the Insights API.
Events
| client.pushEvents | Send events |
User tokens
| client.deleteUserToken | Delete user token |
Did you find this page helpful?