Socket
Socket
Sign inDemoInstall

@atlaskit/analytics-next

Package Overview
Dependencies
4
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/analytics-next


Version published
Weekly downloads
112K
decreased by-15.96%
Maintainers
1
Install size
747 kB
Created
Weekly downloads
 

Package description

What is @atlaskit/analytics-next?

@atlaskit/analytics-next is a package designed to help developers integrate analytics into their applications. It provides tools for tracking user interactions, creating custom analytics events, and managing analytics contexts. This package is particularly useful for applications that require detailed user behavior tracking and reporting.

What are @atlaskit/analytics-next's main functionalities?

Creating Custom Analytics Events

This feature allows developers to create custom analytics events. The code sample demonstrates how to create a new UIAnalyticsEvent with specific payload attributes and log it to the console.

const { AnalyticsListener, UIAnalyticsEvent } = require('@atlaskit/analytics-next');

const handleClick = () => {
  const event = new UIAnalyticsEvent({
    payload: {
      action: 'clicked',
      actionSubject: 'button',
      attributes: {
        componentName: 'MyButton',
        packageName: '@atlaskit/analytics-next',
        packageVersion: '1.0.0'
      }
    }
  });
  console.log(event);
};

handleClick();

Tracking User Interactions

This feature allows developers to track user interactions with components. The code sample shows how to wrap a button component with analytics events, so that a custom event is fired when the button is clicked.

const { withAnalyticsEvents } = require('@atlaskit/analytics-next');

const Button = ({ createAnalyticsEvent }) => (
  <button
    onClick={() => {
      const event = createAnalyticsEvent({
        action: 'clicked',
        actionSubject: 'button'
      });
      event.fire('atlaskit');
    }}
  >
    Click me
  </button>
);

const TrackedButton = withAnalyticsEvents()(Button);

Managing Analytics Contexts

This feature allows developers to manage analytics contexts, providing additional metadata for analytics events. The code sample demonstrates how to wrap a component with an AnalyticsContext to include contextual data.

const { AnalyticsContext } = require('@atlaskit/analytics-next');

const MyComponent = () => (
  <AnalyticsContext data={{ componentName: 'MyComponent' }}>
    <button onClick={() => console.log('Button clicked')}>Click me</button>
  </AnalyticsContext>
);

Other packages similar to @atlaskit/analytics-next

Readme

Source

Analytics-next

Tools for tracking interactions with UI components. Easily capture UI context and state when these events occur.

Maintaince Mode:
This package is officially in maintenance mode, which means only bugfixes or VULN fixes are currently being accepted and no known breaking changes will be approved in the PR process.
Please refer to this DACI for more details.

Installation

yarn add @atlaskit/analytics-next

Usage

Detailed docs and example usage can be found here.

FAQs

Last updated on 18 Aug 2023

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc