{"_id":"@analytics-v0/react","_rev":"5-a1f4f0149cbb3c54d71bb57ef786d21e","name":"@analytics-v0/react","dist-tags":{"latest":"1.0.5"},"versions":{"0.1.0":{"name":"@analytics-v0/react","version":"0.1.0","keywords":["analytics","react","tracking","events","metrics"],"author":"","license":"MIT","_id":"@analytics-v0/react@0.1.0","maintainers":[{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"}],"homepage":"https://github.com/jerrysjoseph/analytics-v0#readme","bugs":{"url":"https://github.com/jerrysjoseph/analytics-v0/issues"},"dist":{"shasum":"2531a6a36d055e07770e8632b63944ab2b91cbea","tarball":"https://registry.npmjs.org/@analytics-v0/react/-/react-0.1.0.tgz","fileCount":19,"integrity":"sha512-3dpPKpR/4a21iHw1Ewb7ZHcOi8HlmNCjk6aVohFMH7d320YZUWJYotRi1pB39JhWzEX9nvF3DSj3IpCdJ1e4hg==","signatures":[{"sig":"MEYCIQCtdm8lbd3Pq6Hi7plms8EnS3bv+pjXd9ncJdcHD5VOOgIhAIPkGg3A4Vifp8NbmQXFn6PMQoM8OKphuWHJjbDkLO2E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90440},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.esm.js","gitHead":"ee64eb21510a3fcae3cf1c1b33f34a128535725a","scripts":{"lint":"eslint src/**/*.{ts,tsx}","test":"jest","build":"rollup -c","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"},"repository":{"url":"git+https://github.com/jerrysjoseph/analytics-v0.git","type":"git"},"_npmVersion":"10.2.4","description":"Simple and lightweight analytics tracking for React applications","directories":{},"sideEffects":false,"_nodeVersion":"20.10.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tslib":"^2.6.2","eslint":"^8.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/react":"^18.2.0","@rollup/plugin-terser":"^0.4.0","@testing-library/react":"^14.0.0","jest-environment-jsdom":"^29.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^5.16.5","@typescript-eslint/parser":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.0","@testing-library/user-event":"^14.4.3","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_0.1.0_1733532999074_0.30980126654010065","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@analytics-v0/react","version":"1.0.1","keywords":["analytics","react","tracking","events","metrics"],"author":"","license":"MIT","_id":"@analytics-v0/react@1.0.1","maintainers":[{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"}],"homepage":"https://github.com/jerrysjoseph/analytics-v0#readme","bugs":{"url":"https://github.com/jerrysjoseph/analytics-v0/issues"},"dist":{"shasum":"c6eb482727ccacc5a295d481523df288b3fe4c89","tarball":"https://registry.npmjs.org/@analytics-v0/react/-/react-1.0.1.tgz","fileCount":14,"integrity":"sha512-cNIUHLmSFT8s0jX1Xd7OjdrYrdvfXIVdb7T5z+ebenE+pEEKtxaPly/9kVMf3U2MwM69wL7BDWCbGGRW0Xq1lw==","signatures":[{"sig":"MEUCIQCg831+/e6lq3TdXkHGnyaXgdxX+LL+JXHUnTWypESJswIgVEY6MRszxwNX9PayXO38nP05QfoP8RBJ4+OK358uUsE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90393},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.esm.js","gitHead":"17bf69ea03bebae37cce007519eb9df847464b54","scripts":{"lint":"eslint src/**/*.{ts,tsx}","test":"jest","build":"rollup -c","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"},"repository":{"url":"git+https://github.com/jerrysjoseph/analytics-v0.git","type":"git"},"_npmVersion":"10.8.2","description":"Simple and lightweight analytics tracking for React applications","directories":{},"sideEffects":false,"_nodeVersion":"18.20.5","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tslib":"^2.6.2","eslint":"^8.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/react":"^18.2.0","@rollup/plugin-terser":"^0.4.0","@testing-library/react":"^14.0.0","jest-environment-jsdom":"^29.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^5.16.5","@typescript-eslint/parser":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.0","@testing-library/user-event":"^14.4.3","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.1_1733540640069_0.904623713385474","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@analytics-v0/react","version":"1.0.2","keywords":["analytics","react","tracking","events","metrics"],"author":{"name":"Jerry S Joseph"},"license":"MIT","_id":"@analytics-v0/react@1.0.2","maintainers":[{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"}],"homepage":"https://github.com/jerrysjoseph/analytics-v0-monorepo#readme","bugs":{"url":"https://github.com/jerrysjoseph/analytics-v0-monorepo/issues"},"dist":{"shasum":"e81a19b77e5f0cdd13275092a5d654fec5984501","tarball":"https://registry.npmjs.org/@analytics-v0/react/-/react-1.0.2.tgz","fileCount":14,"integrity":"sha512-e+h5tk4shRxum4onKX1i4G0sv11STn6DJbxD8xDXB6Tn82Araht3FNngh2z9jFEZ/yTgW4TwArerDlhlGU72fw==","signatures":[{"sig":"MEUCIGGQEdz40Xty8EHtzTzq+LZiVHMEqT+Mo/KkLtEx4vigAiEA/kWkrXxv4yaWcBX3bvQx3LXMrnSxehwqLmpprPUQuQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92458},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"749c8ee9f3d333d3291975027072302a12ffb544","scripts":{"lint":"eslint src/**/*.{ts,tsx}","test":"jest","build":"rollup -c","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"},"repository":{"url":"git+https://github.com/jerrysjoseph/analytics-v0-monorepo.git","type":"git"},"_npmVersion":"10.2.4","description":"Simple and lightweight analytics tracking for React applications","directories":{},"sideEffects":false,"_nodeVersion":"20.10.0","dependencies":{"@packages/analytics":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tslib":"^2.6.2","eslint":"^8.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/react":"^18.2.0","@rollup/plugin-terser":"^0.4.0","@testing-library/react":"^14.0.0","jest-environment-jsdom":"^29.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^5.16.5","@typescript-eslint/parser":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.0","@testing-library/user-event":"^14.4.3","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.2_1733947184028_0.9883765416567742","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@analytics-v0/react","version":"1.0.3","keywords":["analytics","react","tracking","events","metrics"],"author":{"name":"Jerry S Joseph"},"license":"MIT","_id":"@analytics-v0/react@1.0.3","maintainers":[{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"}],"homepage":"https://github.com/jerrysjoseph/analytics-v0-monorepo#readme","bugs":{"url":"https://github.com/jerrysjoseph/analytics-v0-monorepo/issues"},"dist":{"shasum":"93fc3dbdf6c094feb179cbba67c306c5faaf8c74","tarball":"https://registry.npmjs.org/@analytics-v0/react/-/react-1.0.3.tgz","fileCount":14,"integrity":"sha512-T/mvPVjyZwoE7/8Upv2c1PvLVu/xNDuK9NarKcB+ICTVYi14MTApwB2CAljLb3r/Ty95C5BEUAunzuSt5yPmrQ==","signatures":[{"sig":"MEQCIDd12QQMK9d0pNJT4iUMIiBG+OjhYkYL/Ry6Za7xOVMsAiA/mjjd6GgSKlIWfzK2LaP1H+UXdNiZm5ZFiKoHtqEycg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92543},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"749c8ee9f3d333d3291975027072302a12ffb544","scripts":{"lint":"eslint src/**/*.{ts,tsx}","test":"jest","build":"rollup -c","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"},"repository":{"url":"git+https://github.com/jerrysjoseph/analytics-v0-monorepo.git","type":"git"},"_npmVersion":"10.2.4","description":"Simple and lightweight analytics tracking for React applications","directories":{},"sideEffects":false,"_nodeVersion":"20.10.0","dependencies":{"@packages/analytics":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tslib":"^2.6.2","eslint":"^8.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/react":"^18.2.0","@rollup/plugin-terser":"^0.4.0","@testing-library/react":"^14.0.0","jest-environment-jsdom":"^29.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^5.16.5","@typescript-eslint/parser":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.0","@testing-library/user-event":"^14.4.3","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.3_1733996801508_0.19607509505390253","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@analytics-v0/react","version":"1.0.4","keywords":["analytics","react","tracking","events","metrics"],"author":{"name":"Jerry S Joseph"},"license":"MIT","_id":"@analytics-v0/react@1.0.4","maintainers":[{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"}],"homepage":"https://github.com/jerrysjoseph/analytics-v0-monorepo#readme","bugs":{"url":"https://github.com/jerrysjoseph/analytics-v0-monorepo/issues"},"dist":{"shasum":"3de133c82de4f798d4f70dfa9f247a7947963205","tarball":"https://registry.npmjs.org/@analytics-v0/react/-/react-1.0.4.tgz","fileCount":14,"integrity":"sha512-31loFSitF/8G/7Nw0ZiXIctMfJj/NNHibmFN2dob86bqbdxGU/LEltL0vOXX29C5yHTLma7+iAzn92MqI1tr1Q==","signatures":[{"sig":"MEYCIQCNTQv7nMWT7rayO+6NfjK8M9NYcrvg2nbfFp0hxtiYMgIhALMFR6ggrRUKW/3Yic3yNzn1fE3yEATGJjo9XHL29+Wm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92543},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"749c8ee9f3d333d3291975027072302a12ffb544","scripts":{"lint":"eslint src/**/*.{ts,tsx}","test":"jest","build":"rollup -c","publish":"npm run build && npm publish --access public","test:watch":"jest --watch","test:coverage":"jest --coverage"},"_npmUser":{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"},"repository":{"url":"git+https://github.com/jerrysjoseph/analytics-v0-monorepo.git","type":"git"},"_npmVersion":"10.2.4","description":"Simple and lightweight analytics tracking for React applications","directories":{},"sideEffects":false,"_nodeVersion":"20.10.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","tslib":"^2.6.2","eslint":"^8.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/react":"^18.2.0","@rollup/plugin-terser":"^0.4.0","@testing-library/react":"^14.0.0","jest-environment-jsdom":"^29.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^5.16.5","@typescript-eslint/parser":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.0","@testing-library/user-event":"^14.4.3","@typescript-eslint/eslint-plugin":"^6.0.0"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"_npmOperationalInternal":{"tmp":"tmp/react_1.0.4_1733996962880_0.6288567586372724","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@analytics-v0/react","version":"1.0.5","description":"Simple and lightweight analytics tracking for React applications","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","sideEffects":false,"scripts":{"build":"rollup -c","test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"eslint src/**/*.{ts,tsx}","publish":"npm run build && npm publish --access public"},"peerDependencies":{"react":">=16.8.0","react-dom":">=16.8.0"},"devDependencies":{"@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-node-resolve":"^15.0.0","@rollup/plugin-terser":"^0.4.0","@rollup/plugin-typescript":"^11.0.0","@testing-library/jest-dom":"^5.16.5","@testing-library/react":"^14.0.0","@testing-library/user-event":"^14.4.3","@types/jest":"^29.5.0","@types/react":"^18.2.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","jest":"^29.0.0","jest-environment-jsdom":"^29.0.0","rollup":"^3.0.0","ts-jest":"^29.0.0","tslib":"^2.6.2","typescript":"^5.0.0"},"keywords":["analytics","react","tracking","events","metrics"],"author":{"name":"Jerry S Joseph"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/jerrysjoseph/analytics-v0-monorepo.git"},"publishConfig":{"access":"public"},"_id":"@analytics-v0/react@1.0.5","gitHead":"749c8ee9f3d333d3291975027072302a12ffb544","bugs":{"url":"https://github.com/jerrysjoseph/analytics-v0-monorepo/issues"},"homepage":"https://github.com/jerrysjoseph/analytics-v0-monorepo#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-GVvF5IyEOekihCi4Bx1ScdpLC9Ax+J25r8+/YwI09aZtt105k31zRkkh5cTu1PqNJzIMVue0dWBNVlwHkKA7lg==","shasum":"d16071154db0e955c92861dd77ea51dcaa25a92a","tarball":"https://registry.npmjs.org/@analytics-v0/react/-/react-1.0.5.tgz","fileCount":14,"unpackedSize":92543,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8qUJ8zTQOHjU/8wJrNE9+tPLz8KH47e6S0no5E1RXgAiAKFg6AdCi+awIFqtaykLhN1voKFYeyPkqFiFkwB/YxOg=="}]},"_npmUser":{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"},"directories":{},"maintainers":[{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react_1.0.5_1733997007308_0.7032361261271247"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-07T00:56:38.989Z","modified":"2024-12-12T09:50:07.682Z","0.1.0":"2024-12-07T00:56:39.287Z","1.0.1":"2024-12-07T03:04:00.323Z","1.0.2":"2024-12-11T19:59:44.218Z","1.0.3":"2024-12-12T09:46:41.691Z","1.0.4":"2024-12-12T09:49:23.042Z","1.0.5":"2024-12-12T09:50:07.474Z"},"bugs":{"url":"https://github.com/jerrysjoseph/analytics-v0-monorepo/issues"},"author":{"name":"Jerry S Joseph"},"license":"MIT","homepage":"https://github.com/jerrysjoseph/analytics-v0-monorepo#readme","keywords":["analytics","react","tracking","events","metrics"],"repository":{"type":"git","url":"git+https://github.com/jerrysjoseph/analytics-v0-monorepo.git"},"description":"Simple and lightweight analytics tracking for React applications","maintainers":[{"name":"jerin_sebastian","email":"jerin.sebastian153@gmail.com"}],"readme":"# @analytics-v0/react\r\n\r\nA lightweight, privacy-focused analytics tracking library for React applications.\r\n\r\n## Features\r\n\r\n- 📦 Lightweight and easy to integrate\r\n- ⚡ Automatic page view tracking\r\n- 🎯 Custom event tracking\r\n- 🔄 Session management\r\n- 📊 Batched event sending\r\n- 📱 Device and browser information\r\n- 🔍 Debug mode for development\r\n- 📝 TypeScript support\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @analytics-v0/react\r\n# or\r\nyarn add @analytics-v0/react\r\n```\r\n\r\n## Quick Start\r\n\r\n1. Wrap your application with the `AnalyticsProvider`:\r\n\r\n```tsx\r\nimport { AnalyticsProvider } from '@analytics-v0/react';\r\n\r\nfunction App() {\r\n  return (\r\n    <AnalyticsProvider\r\n      config={{\r\n        projectId: 'your-project-id',\r\n        // Optional configurations\r\n        apiEndpoint: 'https://your-api.com/v1',\r\n        debug: true,\r\n        batchSize: 10,\r\n        batchInterval: 5000,\r\n      }}\r\n    >\r\n      <YourApp />\r\n    </AnalyticsProvider>\r\n  );\r\n}\r\n```\r\n\r\n2. Use the `useAnalytics` hook in your components:\r\n\r\n```tsx\r\nimport { useAnalytics } from '@analytics-v0/react';\r\n\r\nfunction CheckoutButton() {\r\n  const analytics = useAnalytics();\r\n\r\n  const handleCheckout = () => {\r\n    analytics.track('checkout_started', {\r\n      cartValue: 99.99,\r\n      currency: 'USD',\r\n      items: 3\r\n    });\r\n    // ... handle checkout logic\r\n  };\r\n\r\n  return <button onClick={handleCheckout}>Checkout</button>;\r\n}\r\n```\r\n\r\n## API Reference\r\n\r\n### AnalyticsProvider\r\n\r\nThe provider component that initializes the analytics system.\r\n\r\n#### Props\r\n\r\n```typescript\r\ninterface AnalyticsConfig {\r\n  projectId: string;\r\n  apiEndpoint?: string;\r\n  debug?: boolean;\r\n  batchSize?: number;\r\n  batchInterval?: number;\r\n  disabled?: boolean;\r\n}\r\n```\r\n\r\n- `projectId` (required): Your project's unique identifier\r\n- `apiEndpoint` (optional): Custom API endpoint for sending events\r\n- `debug` (optional): Enable debug logging\r\n- `batchSize` (optional): Number of events to batch before sending (default: 10)\r\n- `batchInterval` (optional): Maximum time to wait before sending batched events in ms (default: 5000)\r\n- `disabled` (optional): Disable all tracking when true\r\n\r\n### useAnalytics Hook\r\n\r\nThe main hook for tracking events.\r\n\r\n#### Methods\r\n\r\n##### track(name: string, properties?: Record<string, any>)\r\nTrack custom events with optional properties.\r\n\r\n```tsx\r\nconst analytics = useAnalytics();\r\n\r\n// Basic event\r\nanalytics.track('button_click');\r\n\r\n// Event with properties\r\nanalytics.track('product_view', {\r\n  productId: '123',\r\n  category: 'Electronics',\r\n  price: 299.99\r\n});\r\n```\r\n\r\n##### pageView(path: string, properties?: Record<string, any>)\r\nManually track page views (automatic in most cases).\r\n\r\n```tsx\r\nconst analytics = useAnalytics();\r\n\r\n// Track custom page view\r\nanalytics.pageView('/products/123', {\r\n  category: 'Products',\r\n  searchQuery: 'phones'\r\n});\r\n```\r\n\r\n##### identify(userId: string, traits?: Record<string, any>)\r\nAssociate events with a user identity.\r\n\r\n```tsx\r\nconst analytics = useAnalytics();\r\n\r\n// Identify a user\r\nanalytics.identify('user123', {\r\n  email: 'user@example.com',\r\n  plan: 'premium',\r\n  signupDate: '2023-01-01'\r\n});\r\n```\r\n\r\n## Advanced Usage\r\n\r\n### Configuration Options\r\n\r\nThe `AnalyticsProvider` accepts the following configuration options:\r\n\r\n```typescript\r\ninterface AnalyticsConfig {\r\n  projectId: string;        // Required: Your project identifier\r\n  apiEndpoint?: string;     // Optional: Custom API endpoint (default: 'https://api.analytics-v0.com')\r\n  debug?: boolean;          // Optional: Enable debug logging (default: false)\r\n  batchSize?: number;       // Optional: Number of events to batch before sending (default: 10)\r\n  batchInterval?: number;   // Optional: Interval in ms to send batched events (default: 5000)\r\n  disabled?: boolean;       // Optional: Disable all tracking (default: false)\r\n}\r\n```\r\n\r\n### Event Tracking API\r\n\r\nThe `useAnalytics` hook provides the following methods:\r\n\r\n#### track(name: string, properties?: Record<string, any>)\r\nTrack custom events with optional properties:\r\n\r\n```tsx\r\nconst { track } = useAnalytics();\r\n\r\n// Basic event\r\ntrack('button_click');\r\n\r\n// Event with properties\r\ntrack('purchase_complete', {\r\n  productId: '123',\r\n  price: 99.99,\r\n  currency: 'USD'\r\n});\r\n```\r\n\r\n#### pageView(path: string, properties?: Record<string, any>)\r\nTrack page views manually (automatic tracking is enabled by default):\r\n\r\n```tsx\r\nconst { pageView } = useAnalytics();\r\n\r\n// Track current page\r\npageView(window.location.pathname);\r\n\r\n// Track with custom properties\r\npageView('/checkout', {\r\n  referrer: document.referrer,\r\n  title: document.title\r\n});\r\n```\r\n\r\n### Session Management\r\n\r\nSessions are automatically managed with the following behavior:\r\n- New session created on first visit\r\n- Session refreshed on activity\r\n- Session expires after 30 minutes of inactivity\r\n\r\n### Browser Support\r\n\r\n- Chrome, Firefox, Safari, Edge (latest 2 versions)\r\n- IE11 with appropriate polyfills\r\n\r\n### TypeScript Support\r\n\r\nFor better TypeScript support, you can extend the default event properties:\r\n\r\n```typescript\r\ndeclare module '@analytics-v0/react' {\r\n  interface CustomEventProperties {\r\n    productId?: string;\r\n    price?: number;\r\n    category?: string;\r\n    // Add your custom properties here\r\n  }\r\n}\r\n```\r\n\r\n### Error Handling\r\n\r\nThe library includes built-in error handling and will:\r\n- Retry failed network requests\r\n- Queue events when offline\r\n- Sync queued events when back online\r\n\r\n### Performance Considerations\r\n\r\n- Lightweight bundle size (~4KB gzipped)\r\n- Batched network requests\r\n- Debounced event processing\r\n- No external dependencies\r\n\r\n### Security\r\n\r\n- HTTPS-only API endpoints\r\n- No PII collected by default\r\n- Data encryption in transit\r\n- Configurable data retention\r\n\r\n## Automatic Data Collection\r\n\r\nThe library automatically collects the following information:\r\n\r\n- Page views\r\n- Session data\r\n- Browser information\r\n- Screen dimensions\r\n- User timezone\r\n- User language\r\n- Referrer information\r\n\r\n## Example: E-commerce Implementation\r\n\r\n```tsx\r\nimport { useAnalytics } from '@analytics-v0/react';\r\n\r\nfunction ProductPage({ product }) {\r\n  const analytics = useAnalytics();\r\n\r\n  useEffect(() => {\r\n    // Track product view\r\n    analytics.track('product_view', {\r\n      productId: product.id,\r\n      name: product.name,\r\n      price: product.price,\r\n      category: product.category\r\n    });\r\n  }, [product]);\r\n\r\n  const handleAddToCart = () => {\r\n    analytics.track('add_to_cart', {\r\n      productId: product.id,\r\n      name: product.name,\r\n      price: product.price,\r\n      quantity: 1\r\n    });\r\n  };\r\n\r\n  return (\r\n    <div>\r\n      <h1>{product.name}</h1>\r\n      <p>{product.description}</p>\r\n      <button onClick={handleAddToCart}>Add to Cart</button>\r\n    </div>\r\n  );\r\n}\r\n```\r\n\r\n## Best Practices\r\n\r\n1. **Event Naming**\r\n   - Use snake_case for event names\r\n   - Be consistent with naming conventions\r\n   - Use descriptive names (e.g., 'checkout_started' vs 'checkout')\r\n\r\n2. **Properties**\r\n   - Include relevant context in properties\r\n   - Don't include sensitive information\r\n   - Keep property names consistent across events\r\n\r\n3. **User Identification**\r\n   - Call identify() after user authentication\r\n   - Include relevant user traits\r\n   - Don't include personal identifiable information (PII) unless necessary\r\n\r\n4. **Performance**\r\n   - Events are automatically batched\r\n   - Use the disabled prop in development/testing\r\n   - Monitor debug logs in development\r\n\r\n## Contributing\r\n\r\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\r\n\r\n## License\r\n\r\nMIT License - see LICENSE file for details\r\n","readmeFilename":"README.md"}