npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

alytica-react-native

v1.0.0

Published

A React Native package to interact with Alytica API for web and product analytics

Readme

Alytica React Native SDK

A React Native SDK for integrating with the Alytica analytics platform. Track events, identify users, and gain valuable insights into your app's performance and user behavior.

Installation

npm install alytica-react-native
# or
yarn add alytica-react-native

Quick Start

import Alytica from 'alytica-react-native';

// Initialize the Alytica client
const alytica = new Alytica({
  clientId: 'YOUR_CLIENT_ID',
  api_host: 'https://api.alytica.tech',
  debug: false,
});

// Initialize the SDK
alytica.init();

// Track an event
alytica.track('button_clicked', {
  buttonName: 'Sign Up',
  source: 'home_screen'
});

// Identify a user
alytica.identify('user123', {
  email: '[email protected]',
  plan: 'premium'
});

Key Features

  • Event Tracking: Track user interactions and custom events
  • User Identification: Associate events with specific users
  • Session Management: Track user sessions automatically
  • Group Analytics: Organize users into groups for better analysis
  • Customizable: Set global properties to include with all tracked events

API Reference

Initialization

const alytica = new Alytica({
  clientId: 'YOUR_CLIENT_ID',     // Required
  clientSecret: 'YOUR_SECRET',    // Optional, for secure server-side tracking
  api_host: 'https://api.alytica.tech', // Optional, defaults to https://api.alytica.tech
  debug: false,                  // Optional, enables debug logging
  disabled: false,               // Optional, disables all tracking
  processProfiles: true          // Optional, enables user profile processing
});

alytica.init();

Tracking Events

// Simple event
alytica.track('page_viewed');

// Event with properties
alytica.track('product_added', {
  productId: '123',
  price: 99.99,
  currency: 'USD'
});

User Identification

// Associate a user ID with the current user
alytica.identify('user123');

// Associate a user ID with additional properties
alytica.identify('user123', {
  name: 'John Doe',
  email: '[email protected]',
  plan: 'premium'
});

Group Analytics

// Associate a user with a group
alytica.group('company', 'acme_inc');

// With additional properties
alytica.group('company', 'acme_inc', {
  plan: 'enterprise',
  employees: 500
});

User Aliasing

// Associate an anonymous ID with a new user ID
alytica.alias('user123', 'anonymous_id_456');

Global Properties

// Set properties to be included in all tracked events
alytica.setGlobalProperties({
  appVersion: '1.2.3',
  environment: 'production'
});

Reset User

// Reset the current user, generating a new anonymous ID
await alytica.reset();

Screen View Tracking

With Expo Router

import { usePathname, useSegments } from 'expo-router';
import Alytica from 'alytica-react-native';

const alytica = new Alytica({
  clientId: 'YOUR_CLIENT_ID',
  api_host: 'https://api.alytica.tech',
});

function RootLayout() {
  // ...
  const pathname = usePathname();
  // Segments is optional but can be nice to have if you
  // want to group routes together
  // pathname = /posts/123
  // segments = ['posts', '[id]']
  const segments = useSegments();

  useEffect(() => {
    // Simple
    alytica.track('screen_view', { screen: pathname });

    // With extra data
    alytica.track('screen_view', {
      screen: pathname,
      // segments is optional but nice to have
      segments: segments.join('/'),
      // other optional data you want to send with the screen view
    });
  }, [pathname, segments]);
  // ...
}

With React Navigation

import { createNavigationContainerRef, NavigationContainer } from '@react-navigation/native';
import Alytica from 'alytica-react-native';

const alytica = new Alytica({
  clientId: 'YOUR_CLIENT_ID',
  api_host: 'https://api.alytica.tech',
});

const navigationRef = createNavigationContainerRef();

export function NavigationRoot() {
  const handleNavigationStateChange = () => {
    const current = navigationRef.getCurrentRoute();
    if (current) {
      alytica.track('screen_view', {
        screen: current.name,
        params: current.params,
      });
    }
  };

  return (
    <NavigationContainer
      ref={navigationRef}
      onReady={handleNavigationStateChange}
      onStateChange={handleNavigationStateChange}
    >
      <Stack.Navigator />
    </NavigationContainer>
  );
}

License

MIT