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

@entrolytics/astro-sdk

v2.2.0

Published

Astro SDK for Entrolytics - First-party growth analytics for the edge

Readme

npm License: MIT TypeScript Astro


Overview

@entrolytics/astro-sdk is the official Astro SDK for Entrolytics - first-party growth analytics for the edge. Add analytics to your Astro sites with a single integration.

Why use this SDK?

  • Zero-config Astro integration - just add to astro.config.mjs
  • Automatic View Transitions support
  • Outbound link and file download tracking
  • Edge-optimized with sub-50ms response times globally

Key Features

Analytics

  • Automatic page view tracking
  • Outbound link tracking
  • File download tracking
  • Cross-domain tracking

Developer Experience

  • Astro integration plugin
  • Client module for manual tracking
  • View Transitions aware
  • Full TypeScript support

Quick Start

Installation

npm install @entrolytics/astro-sdk
# or
pnpm add @entrolytics/astro-sdk
// astro.config.mjs
import { defineConfig } from 'astro/config';
import entrolytics from '@entrolytics/astro-sdk';

export default defineConfig({
  integrations: [
    entrolytics(), // Zero-config: reads from .env
  ],
});

Add to your .env file:

PUBLIC_ENTROLYTICS_WEBSITE_ID=your-website-id
PUBLIC_ENTROLYTICS_HOST=https://entrolytics.click

That's it! The integration automatically injects the tracking script and handles View Transitions.

Configuration Options

Zero-Config (Recommended)

integrations: [entrolytics()] // Reads from PUBLIC_ENTROLYTICS_WEBSITE_ID

Explicit Configuration

entrolytics({
  // Required: Your Entrolytics website ID
  websiteId: 'your-website-id',

  // Optional: Custom host (for self-hosted instances)
  host: 'https://entrolytics.click',

  // Optional: Auto-track page views (default: true)
  autoTrack: true,

  // Optional: Track outbound link clicks (default: true)
  trackOutboundLinks: true,

  // Optional: Track file downloads (default: false)
  trackFileDownloads: false,

  // Optional: Respect Do Not Track (default: false)
  respectDnt: false,

  // Optional: Cross-domain tracking
  domains: ['example.com', 'blog.example.com'],
});

Runtime Configuration

Entrolytics supports two collection runtimes with different performance characteristics:

Edge Runtime (Default)

The edge runtime uses /script-edge.js for sub-50ms global latency:

entrolytics({
  websiteId: 'your-website-id',
  useEdgeRuntime: true, // Default
});

Benefits:

  • Sub-50ms response times globally
  • Optimal for high-traffic sites
  • Best user experience

Limitations:

  • Basic geo data (country-level)
  • No ClickHouse export

Node.js Runtime

The Node.js runtime uses /script.js with advanced capabilities:

entrolytics({
  websiteId: 'your-website-id',
  useEdgeRuntime: false, // Use Node.js runtime
});

Benefits:

  • ClickHouse data export support
  • MaxMind GeoIP (city-level accuracy)
  • Advanced analytics features

Latency: 50-150ms (regional)

When to Use Each Runtime

Use Edge Runtime (default) when:

  • You prioritize speed (<50ms response times)
  • You have high request volume
  • Country-level geo data is sufficient

Use Node.js Runtime when:

  • You need ClickHouse export for data warehousing
  • You require city-level geo accuracy
  • Self-hosted Astro deployments without edge support
  • Advanced analytics workflows

See the Routing documentation for more details.

Manual Event Tracking

For tracking custom events in your Astro components:

---
// In your Astro component
---

<script>
  // Track a button click
  document.getElementById('my-button').addEventListener('click', () => {
    if (window.entrolytics) {
      window.entrolytics.track('button_click', {
        button_id: 'hero-cta',
        page: window.location.pathname
      });
    }
  });
</script>

<button id="my-button">Click me</button>

Using the Client Module

---
import { trackEvent } from '@entrolytics/astro/client';
---

<script>
  import { trackEvent, identify } from '@entrolytics/astro/client';

  // Track events
  trackEvent('signup_click', { plan: 'pro' });

  // Identify users
  identify('user-123', { email: '[email protected]' });
</script>

View Transitions Support

The integration automatically works with Astro's View Transitions. Page views are re-tracked on each navigation.

TypeScript

Full TypeScript support included:

import type { EntrolyticsOptions } from '@entrolytics/astro';

const options: EntrolyticsOptions = {
  websiteId: 'your-id',
  trackOutboundLinks: true,
};

License

MIT License - see LICENSE file for details.