About this project

@vskstudio/takt-react is a thin React layer over the Takt privacy-friendly analytics core. It provides a root Takt component for booting the browser SDK and supplying an instance to descendants, useTakt for imperative tracking, and useTaktEvent or TaktEvent for declarative click events. It also includes a React-free custom element for non-React pages. The wrapper is designed for server rendering: browser initialization happens after mount, the hook returns a safe no-op before initialization or during SSR, and the package includes a client boundary for Next.js applications. Options include SPA navigation, outbound links, file downloads, 404 tracking, Do Not Track, localhost exclusion, sampling, query controls, path exclusion, and URL scrubbing. Badge and embed widgets plus public statistics APIs are re-exported from the core package. React 18 or 19 and Takt core 0.8.1 or newer are peer dependencies. The project is released under the MIT license.