-
Notifications
You must be signed in to change notification settings - Fork 745
Update capture tutorial #13335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update capture tutorial #13335
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 2 comments
|
|
||
| PostHog captures events through `/i/v0/e/` endpoint of your project region. | ||
|
|
||
| For your PostHog project (if you're authenticated on [PostHog](https://app.posthog.com/)), the fill URL is: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Typo: "fill URL" should be "full URL"
| For your PostHog project (if you're authenticated on [PostHog](https://app.posthog.com/)), the fill URL is: | |
| For your PostHog project (if you're authenticated on [PostHog](https://app.posthog.com/)), the full URL is: |
Prompt To Fix With AI
This is a comment left during a code review.
Path: contents/tutorials/api-capture-events.mdx
Line: 42:42
Comment:
**syntax:** Typo: "fill URL" should be "full URL"
```suggestion
For your PostHog project (if you're authenticated on [PostHog](https://app.posthog.com/)), the full URL is:
```
How can I resolve this? If you propose a fix, please make it concise.| }; | ||
|
|
||
| const body = { | ||
| "api_key": process.env.POSTHOG_API_KEY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Inconsistent environment variable - using process.env.POSTHOG_API_KEY but first example uses hardcoded <ph_project_api_key> placeholder and line 111 uses process.env.POSTHOG_API_HOST
| "api_key": process.env.POSTHOG_API_KEY, | |
| "api_key": "<ph_project_api_key>", |
Prompt To Fix With AI
This is a comment left during a code review.
Path: contents/tutorials/api-capture-events.mdx
Line: 186:186
Comment:
**style:** Inconsistent environment variable - using `process.env.POSTHOG_API_KEY` but first example uses hardcoded `<ph_project_api_key>` placeholder and line 111 uses `process.env.POSTHOG_API_HOST`
```suggestion
"api_key": "<ph_project_api_key>",
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can update the date published
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ye
| ```bash | ||
| #!/bin/bash | ||
|
|
||
| # Load environment variables from .env file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to load all the environment variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, do we need to escape everything? The other examples don't escape things and they work fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this, I get zsh: command not found: md5sum {"status":"Ok"}%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to the examples repo so we can run these nightly to check. The escaping is related. I'll clean it up.
md5sum is a package I have locally 🤔 Didn't realize this is not a system package. will update
Changes
Just some small improvements as I'm learning the APIs