Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@algolia/client-insights

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/client-insights

JavaScript client for client-insights

  • 5.12.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
214K
increased by23.74%
Maintainers
3
Weekly downloads
 
Created

What is @algolia/client-insights?

@algolia/client-insights is an npm package that allows developers to send events to Algolia's Insights API. This is useful for tracking user interactions with search results, which can then be used to improve search relevance and user experience.

What are @algolia/client-insights's main functionalities?

Initialize the Insights Client

This feature allows you to initialize the Insights client with your Algolia application ID and API key. This is the first step in using the client to send events.

const { createInsightsClient } = require('@algolia/client-insights');
const insightsClient = createInsightsClient({
  appId: 'YourApplicationID',
  apiKey: 'YourSearchOnlyAPIKey'
});

Send Click Event

This feature allows you to send a click event to the Algolia Insights API. You specify the event type, name, index, user token, and object IDs that were clicked.

insightsClient.sendEvent({
  eventType: 'click',
  eventName: 'Product Clicked',
  index: 'your_index_name',
  userToken: 'user-123',
  objectIDs: ['objectID1']
});

Send Conversion Event

This feature allows you to send a conversion event, such as a purchase, to the Algolia Insights API. Similar to click events, you specify the event type, name, index, user token, and object IDs involved in the conversion.

insightsClient.sendEvent({
  eventType: 'conversion',
  eventName: 'Product Purchased',
  index: 'your_index_name',
  userToken: 'user-123',
  objectIDs: ['objectID1']
});

Send View Event

This feature allows you to send a view event to the Algolia Insights API. This is useful for tracking when a user views a product or item in your application.

insightsClient.sendEvent({
  eventType: 'view',
  eventName: 'Product Viewed',
  index: 'your_index_name',
  userToken: 'user-123',
  objectIDs: ['objectID1']
});

Other packages similar to @algolia/client-insights

FAQs

Package last updated on 30 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc