@vutolabs/analytics
Version:
Vuto Analytics - instant, Stripe-native analytics for SaaS apps built with Next.js or React.
33 lines (30 loc) • 1.01 kB
TypeScript
import { A as AnalyticsProps } from '../types-BAYME2We.js';
/**
* Adds the `<Analytics />` component to the page body and starts tracking page views.
*
* @param [props.mode] - The mode to use for the analytics script. Defaults to `auto`.
* - `auto` - Automatically detect the environment. Uses `production` if the environment cannot be determined.
* - `production` - Always use the production script. (Sends events to the server)
* - `development` - Always use the development script. (Logs events to the console)
*
* @example
* ```tsx
* import { Analytics } from '@vutolabs/analytics/next';
*
* export default function RootLayout({ children }: { children: React.ReactNode }) {
* return (
* <html lang="en">
* <head>
* <title>Next.js</title>
* </head>
* <body>
* {children}
* <Analytics />
* </body>
* </html>
* );
* }
* ```
*/
declare function Analytics(props: AnalyticsProps): null;
export { Analytics, AnalyticsProps };