About this project

The @vskstudio/takt-solid package is a thin, server‑side‑rendering safe layer that integrates the Takt privacy‑friendly analytics core into SolidJS applications. It does not modify the payload or privacy guarantees of the underlying core; it simply makes the API feel native to Solid. Key components: - Takt component: placed near the application root, it initializes analytics on mount, sends an initial pageview, tracks SPA navigation and provides the analytics instance to the component tree. - useTakt hook: resolves the live analytics instance at call time. Before the Takt component mounts, or during server rendering, it returns a no‑operation object that never throws, allowing event calls to be placed safely in handlers. - createTaktEvent function and TaktEvent component: declarative ways to track click events without writing explicit handlers. Both resolve the active instance at click time. - takt‑analytics custom element: a framework‑agnostic web component that can be used on non‑Solid pages. Importing the side‑effect entry registers the element without pulling in the Solid runtime. - TaktBadge and TaktEmbed widgets: thin wrappers that render a badge image or an iframe embed with secure sandbox and referrer policies. - createStats function: provides a typed client for the public Takt API, enabling programmatic retrieval of statistics such as summary data. Installation requires pnpm (or npm/yarn) and the peer dependencies solid‑js version 1.8 or newer and @vskstudio/takt-core version 0.8.1 or newer. Configuration is supplied via props on the Takt component or attributes on the custom element. Options include domain, endpoint, outbound link tracking, file download tracking, SPA navigation tracking, 404 reporting, Do Not Track respect, localhost exclusion, sampling rate, query string handling, URL scrubbing, and a master enabled switch. Props are read once at mount; changes require remounting. The library is fully SSR‑compatible: the Takt component only runs on the client inside onMount, and useTakt returns a safe no‑op during server rendering. Importing the custom element on the server is a no‑op guarded by a customElements check. All privacy‑related behavior—such as DNT support, localhost exclusion, consent handling, and payload freezing—is implemented in the core library and is not altered by this wrapper. License: MIT.