Skip to content
Sapphire UIv4.1.0

Analytics

Load consent-aware analytics for a site. Use it when measurement must follow the visitor’s privacy choices rather than start on every page load.

Examples

Props

Generated from the current public TypeScript signatures, including composed behaviour props. “—” means no default is declared in the local signature; forwarded behaviour defaults are not inferred.

Analytics

Analytics component props
PropTypeRequiredLocal default
gaIdstring | undefinedNo—
posthogTokenstring | undefinedNo—
posthogHoststring | undefinedNo—
posthogUiHoststring | undefinedNo—
domainsstring | undefinedNo—

Setup

bun add @kongmy-dev/sapphire-ui react react-dom

For an app using package components throughout, load the full stylesheet once. Add this component import where you use it.

import "@kongmy-dev/sapphire-ui/sapphire.css";
import { Analytics } from "@kongmy-dev/sapphire-ui/analytics";

Mixing package and vendored components? Follow application setup.

Search documentation