Source snapshot bcc79fcc · Declared package version 2.0.5. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.
Provider-neutral orchestration for continuous creator and content analytics on YouTube, TikTok, Instagram, and X.
The runtime selects an available source in this order: official API, approved connector, then the optional public metadata fallback. It discovers creator content, records idempotent 30-minute snapshots, builds deterministic UTC hourly/daily/weekly rollups, exports analytics as CSV, deduplicates webhooks, and applies configurable retention.
ts
import { createSocialTrackingService, PrioritySocialTrackingSourceRegistry } from "@lssm-tech/integration.social-tracking-runtime";
import { createPostgresSocialTrackingStore, migratePostgresSocialTrackingStore } from "@lssm-tech/integration.social-tracking-runtime/postgres";
await migratePostgresSocialTrackingStore(database);
const store = createPostgresSocialTrackingStore({ database });
const registry = new PrioritySocialTrackingSourceRegistry(sources);
const tracking = createSocialTrackingService({ registry, store });
await tracking.startCreatorTracking({
consumerKey: "analytics-dashboard",
context,
idempotencyKey: "onboard:youtube:creator-123",
platform: "youtube",
selector: { id: "creator-123" },
});
The public-metadata entrypoint exposes a hardened yt-dlp runner and metadata-only source. Only HTTPS URLs for supported public platform hosts are accepted; credentials, cookies, downloads, playlists, and shell evaluation are disabled.
For TikTok, Instagram, and X standalone content tracking, pass the canonical HTTPS content URL as contentId. Opaque non-YouTube ids are intentionally not expanded into guessed URLs.
Postgres persistence treats (tenantId, workspaceId) as an inseparable scope. Callers must migrate once, then supply scope on every read, collection, retention, and analytics operation.
Tracking lifecycle starts require a caller-owned idempotency key. Replaying the same key within a tenant, workspace, and consumer returns the original config without repeating provider discovery. Analytics snapshots, rollups, queries, exports, and retention are partitioned by consumerKey.
Retention resolves in deterministic precedence order: runtime defaults, then the optional tenant/platform/consumer resolver, then explicit start-call overrides. Weekly rollups remain indefinite unless weeklyDays is configured by the resolver or call.
Declared capabilities.
Integration Social Tracking Runtime
Provider-neutral social analytics tracking runtime with Postgres persistence and public metadata fallback.
Use it to
Adopt provider-neutral social analytics tracking runtime with postgres persistence and public metadata fallback
Requires
TypeScript
Choose another boundary when
The @lssm-tech/integration.social-tracking-runtime package constraints do not match the target runtime or platform.
These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.