@aman-sagar06077/zappa-analytics 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +7 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,10 +12,16 @@ npm i @aman-sagar06077/zappa-analytics
12
12
  import { Analytics } from '@aman-sagar06077/zappa-analytics/next';
13
13
 
14
14
  export default function RootLayout({ children }: { children: React.ReactNode }) {
15
- return <html><body>{children}<Analytics projectId="YOUR_PROJECT_ID" writeKey="Zappa_YOUR_PROJECT_WRITE_KEY" /></body></html>;
15
+ return <html><body>{children}<Analytics
16
+ projectId={process.env.NEXT_PUBLIC_ZAPPA_PROJECT_ID!}
17
+ writeKey={process.env.NEXT_PUBLIC_ZAPPA_WRITE_KEY!}
18
+ endpoint={process.env.NEXT_PUBLIC_ZAPPA_ORIGIN + '/api/events'}
19
+ /></body></html>;
16
20
  }
17
21
  ```
18
22
 
23
+ Copy the project-specific `NEXT_PUBLIC_ZAPPA_PROJECT_ID`, `NEXT_PUBLIC_ZAPPA_WRITE_KEY`, and `NEXT_PUBLIC_ZAPPA_ORIGIN` values from Zappa's Installation setup into `.env.local` and your production hosting environment. These values are public browser configuration; the write key scopes events to one project and is not a secret.
24
+
19
25
  ## Any JavaScript site
20
26
 
21
27
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aman-sagar06077/zappa-analytics",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Privacy-aware website analytics for Zappa projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",