embed-analytics
v1.1.10
Published
Embed-Analytics leverages Generative AI to empower your data with rich insights and dynamic visualizations. Seamlessly integrate event tracking, harness the power of AI-generated analyses, and unlock a deeper understanding of your data for informed decisi
Downloads
6
Readme
Embed-Analytics
Embed-Analytics streamlines event injestion and data procesing through a seamless integration into systems. This library enables effortless creation and transmission of event data, ensuring smooth handling for real-time processing. With asynchronous capabilities, it empowers users to efficiently inject and process data streams, leveraging Generative AI for insightful analytics and visualization generation
Installation
You can install Embed-Analytics using npm:
npm install embed-analytics
Usage
Initial Setup
API Key: Ensure you have an
API_KEY
provided to you. This key is essential for authentication and routing your events.Configuration File:
- Create a configuration file to store your
API_KEY
. - The file should be in the following format:
API_KEY=uMMxxxxxxxxxxxxxxxxxxbW6b
- By default, the library looks for a file named
ea.env
in the same directory as the library import. However, you can use any file name and location, just make sure to specify the path when initializing.
- Create a configuration file to store your
Integration
Importing the Library:
- In your project, import
embed-analytics
:const embedAnalytics = require('embed-analytics');
- In your project, import
Initializing the Library:
- Initialize
embed-analytics
with your configuration file (assuming the defaultea.env
file location):embedAnalytics.init();
- Initialize
Event Handling
Creating an Event Object:
- Define an object to describe the event you want to record:
const eventObj = { 'device-id': 'camera-OC-12', 'location': 'Station #3' };
- Define an object to describe the event you want to record:
Pushing an Event:
- Use the
pushEvent
API to send your event:pushMyEvent(eventObj); async function pushMyEvent(eventObj) { const push = await embedAnalytics.pushEvent(eventObj); }
- Use the
Contributing
We welcome contributions! If you have any ideas for improvements or new features, please open an issue to discuss it before submitting a pull request.