Skip to content

Conversation

@gewenyu99
Copy link
Contributor

Changes

Just some small improvements as I'm learning the APIs

  • Updates capture tutorial
  • Adds base url and endpoint info. This flows a little more like the typical API tutorial
  • Adds capturing in node.js fetch
  • Adds capturing for error tracking and link to LLM analytics
  • Will make sure these work in the future with API examples.  examples#3

@gewenyu99 gewenyu99 requested a review from a team October 22, 2025 00:57
@vercel
Copy link

vercel bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
posthog Ready Ready Preview Oct 22, 2025 4:18pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile


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:
Copy link
Contributor

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"

Suggested change
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,
Copy link
Contributor

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

Suggested change
"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.

Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

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"}%

Copy link
Contributor Author

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

@gewenyu99 gewenyu99 merged commit 9b76cc8 into master Oct 22, 2025
7 checks passed
@gewenyu99 gewenyu99 deleted the update-capture-tutorial branch October 22, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants