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

@tiledev/sdk-analytics-core

v0.1.0

Published

Dependency-free analytics contract for TilePacket apps: the AnalyticsAdapter interface every provider implements, the DefaultEvents catalogue, and the device/event wire types. Imported by @tiledev/sdk-analytics-* and the theme's AnalyticsService, which ho

Downloads

179

Readme

@tiledev/sdk-analytics-core

The dependency-free analytics contract shared by every @tiledev/sdk-analytics-* provider and the theme's AnalyticsService. This package is types + events only — no runtime, no registry, no React. It defines:

  • AnalyticsAdapter — the interface each provider (firebase, segment, klaviyo, moengage, appsflyer, clevertap, facebook-pixel, tiktok) implements.
  • DefaultEvents / ApptileCoreEvents — the canonical event-name catalogue (ported from the platform's ApptileAnalytics/DefaultEvents.ts + the keys the per-provider transformers switch on).
  • EventProperties / UserTraits and the device/event wire types (AnalyticsEvent, AnalyticsContext, CampaignParams, …).
npm install @tiledev/sdk-analytics-core

No peer dependencies — this is a pure types + constants package.

The adapter contract

interface AnalyticsAdapter {
  name: string;
  init?(): void | Promise<void>;
  identify?(userId: string, traits?: UserTraits): void;
  track?(event: string, properties?: EventProperties): void;
  screen?(name: string, properties?: EventProperties): void;
  reset?(): void;
  setUserProperties?(props: EventProperties): void;
  logError?(error: Error, context?: EventProperties): void;
}

Every method is optional — an adapter wires only the surface its vendor supports. Each @tiledev/sdk-analytics-* package exports a create…Adapter(options): AnalyticsAdapter factory that returns one of these.

Wiring: the theme's AnalyticsService is the single integration point

There is no registry here. The theme's AnalyticsService (src/core/services/analytics.ts) holds an array of registered adapters and fans every initialize / identify / track / screen / reset / logError call out over them with a for-loop — each provider's logic stays inside its own AnalyticsAdapter. Register the enabled providers with use() (or register(), or the constructor):

import { analytics } from '@/core/services/analytics'; // the theme AnalyticsService singleton
import { createFirebaseAnalyticsAdapter } from '@tiledev/sdk-analytics-firebase';
import { createSegmentAnalyticsAdapter } from '@tiledev/sdk-analytics-segment';

// Register every enabled provider. Each adapter owns its own track/identify/screen/... logic;
// AnalyticsService just loops over the registered adapters.
analytics.use([
  createFirebaseAnalyticsAdapter({ /* config via options */ }),
  createSegmentAnalyticsAdapter({ writeKey: '…' }),
  // clevertap / appsflyer / facebook-pixel / tiktok / klaviyo / moengage
]);
// <AnalyticsProvider> already uses the `analytics` singleton — nothing else to wire

The theme's public AnalyticsService surface (initialize / identify / track / screen / reset / logError / setEnabled) is unchanged, so <AnalyticsProvider> consumes the analytics singleton with no cast and no per-SDK provider.

Default lifecycle events

ApptileCoreEvents / DefaultEvents carry the canonical names the theme emits — apptile_first_open / apptile_app_open, addToCart, purchase, … — which each provider adapter maps onto its vendor's event vocabulary.

Development

npm run build   # clean + tsc
npm run lint    # tsc --noEmit