Skip to content

Commit dbf5252

Browse files
authored
Merge branch 'master' into korean-landing
2 parents 596f833 + be4b6b1 commit dbf5252

31 files changed

+280
-267
lines changed

contents/docs/error-tracking/_snippets/cli/authenticate.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ If you are using the CLI in a CI/CD environment such as GitHub Actions, you can
1111
| Environment Variable | Description | Source |
1212
| --- | --- | --- |
1313
| `POSTHOG_CLI_HOST` | The PostHog host to connect to [default: https://us.posthog.com] | [Project settings](https://app.posthog.com/settings/project#variables) |
14-
| `POSTHOG_CLI_ENV_ID` | PostHog project ID | [Project settings](https://app.posthog.com/settings/project#variables) |
15-
| `POSTHOG_CLI_TOKEN` | **Personal API key** with `error tracking write` and `organization read` scopes | [API key settings](https://app.posthog.com/settings/user-api-keys#variables) |
14+
| `POSTHOG_CLI_PROJECT_ID` | PostHog project ID | [Project settings](https://app.posthog.com/settings/project#variables) |
15+
| `POSTHOG_CLI_API_KEY` | **Personal API key** with `error tracking write` and `organization read` scopes | [API key settings](https://app.posthog.com/settings/user-api-keys#variables) |
1616

1717
</div>
1818

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
```bash
22
# Inject release and chunk metadata into sourcemaps
3-
posthog-cli sourcemap inject --directory ./path/to/assets --project my-app --version 1.2.3
3+
posthog-cli sourcemap inject --directory ./path/to/assets
44
```
5-
6-
The CLI will create or reuse the [release](/docs/error-tracking/releases) for the detected or supplied project and version. The CLI will try to detect project and version information, but you can set them explicitly with `--project` and `--version`. We recommend setting the project, and letting the CLI detect the version, if your project is continuously deployed (the version will be the git commit hash at build time).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
```bash
22
# Upload injected sourcemaps to their release
3-
posthog-cli sourcemap upload --directory ./path/to/assets
3+
posthog-cli sourcemap upload --directory ./path/to/assets --release-name my-app --release-version 1.2.3
44
```
55

6-
The CLI reuses the release stored during injection, so you don't need to pass `--project` or `--version` again.
6+
The CLI will create or reuse the [release](/docs/error-tracking/releases) for the detected or supplied release name and version. The CLI will try to detect release name and version information, but you can set them explicitly with `--release-name` and `--release-version`. We recommend setting the release name, and letting the CLI detect the version, if your project is continuously deployed (the version will be the git commit hash at build time).
77

88
> **💡 Tip:** You can use `--delete-after` option to clean up sourcemaps after uploading them.

contents/docs/error-tracking/_snippets/nextjs-upload-source-maps.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ const nextConfig = {
1818

1919
export default withPostHogConfig(nextConfig, {
2020
personalApiKey: process.env.POSTHOG_API_KEY, // Personal API Key
21-
envId: process.env.POSTHOG_ENV_ID, // Environment ID
21+
projectId: process.env.POSTHOG_PROJECT_ID, // Project ID
2222
host: process.env.NEXT_PUBLIC_POSTHOG_HOST, // (optional), defaults to https://us.posthog.com
2323
sourcemaps: { // (optional)
2424
enabled: true, // (optional) Enable sourcemaps generation and upload, default to true on production builds
25-
project: "my-application", // (optional) Project name, defaults to repository name
26-
version: "1.0.0", // (optional) Release version, defaults to current git commit
25+
releaseName: "my-application", // (optional) Release name, defaults to repository name
26+
releaseVersion: "1.0.0", // (optional) Release version, defaults to current git commit
2727
deleteAfterUpload: true, // (optional) Delete sourcemaps after upload, defaults to true
2828
},
2929
});
@@ -35,7 +35,7 @@ Where you should set the following environment variables:
3535
| Environment Variable | Description |
3636
| --- | --- |
3737
| `POSTHOG_API_KEY` | [Personal API key](https://app.posthog.com/settings/user-api-keys#variables) with at least `write` access on `error tracking` |
38-
| `POSTHOG_ENV_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/environment#variables) |
38+
| `POSTHOG_PROJECT_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/project#variables) |
3939
| `NEXT_PUBLIC_POSTHOG_HOST` | Your PostHog instance URL. Defaults to `https://us.posthog.com` |
4040

4141
### That's it!

contents/docs/error-tracking/installation/_snippets/error-tracking-nextjs-installation-wrapper.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import { addNextStepsStep } from './shared-helpers'
77
export const ErrorTrackingNextJSInstallationWrapper = () => {
88
return (
99
<OnboardingContentWrapper snippets={{ JSEventCapture }}>
10-
<NextJSInstallation
11-
modifySteps={(steps) => addNextStepsStep(steps).filter((s) => s.title !== 'Upload source maps')}
12-
/>
10+
<NextJSInstallation modifySteps={addNextStepsStep} />
1311
</OnboardingContentWrapper>
1412
)
1513
}

contents/docs/error-tracking/releases.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Error tracking displays this release info over stack traces to help you track do
1717

1818
## Creating releases
1919

20-
Release information is automatically created when you [inject sourcemaps](/docs/error-tracking/upload-source-maps/) using `posthog-cli sourcemap inject`. If you use frameworks with a PostHog package like [Next.js](/docs/error-tracking/upload-source-maps/nextjs) or [Nuxt](/docs/error-tracking/upload-source-maps/nuxt), this is handled for you.
20+
Release information is automatically created when you [upload sourcemaps](/docs/error-tracking/upload-source-maps/) using `posthog-cli sourcemap upload`. If you use frameworks with a PostHog package like [Next.js](/docs/error-tracking/upload-source-maps/nextjs) or [Nuxt](/docs/error-tracking/upload-source-maps/nuxt), this is handled for you.
2121

22-
The CLI finds or creates the release for the project and version it detects, and stores that link inside each sourcemap. You can specify `--project` and `--version` yourself; otherwise the CLI inspects Git metadata (like the repo name and commit SHA) to choose sensible values. Artefacts are locked to their release once written, so they cannot move between releases later.
22+
The CLI finds or creates the release for the project and version it detects, and stores that link inside each sourcemap. You can specify `--release-name` and `--release-version` yourself; otherwise the CLI inspects Git metadata (like the repo name and commit SHA) to choose sensible values. Artefacts are locked to their release once written, so they cannot move between releases later.
2323

2424
## Uploading artefacts
2525

contents/docs/error-tracking/upload-source-maps/github-actions.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636

3737
# Inject and upload source maps using the PostHog action
3838
- name: Inject & upload source maps to PostHog
39-
uses: PostHog/upload-source-maps@v0.4.6
39+
uses: PostHog/upload-source-maps@v2
4040
with:
4141
directory: dist
42-
env-id: ${{ secrets.POSTHOG_ENV_ID }}
43-
cli-token: ${{ secrets.POSTHOG_CLI_TOKEN }}
42+
project-id: ${{ secrets.POSTHOG_PROJECT_ID }}
43+
api-key: ${{ secrets.POSTHOG_CLI_API_KEY }}
4444
# host: https://eu.posthog.com # Required only for EU cloud
45-
# project: my-awesome-project # Optional; falls back to repo name
46-
# version: ${{ github.sha }} # Optional; falls back to current commit SHA
45+
# release-name: my-awesome-project # Optional; falls back to repo name
46+
# release-version: ${{ github.sha }} # Optional; falls back to current commit SHA
4747
```
4848

4949
This step:
@@ -61,15 +61,15 @@ This step:
6161
| **Name** | **Required** | **Description** |
6262
| --- | --- | --- |
6363
| `directory` | Yes | Directory containing built assets (for example, `dist`) |
64-
| `env-id` | Yes | PostHog project ID. Get it from your [project settings](https://app.posthog.com/settings/environment#variables) |
65-
| `cli-token` | Yes | Personal API key with error tracking write and organization read scopes. Get it from your [personal API key settings](https://app.posthog.com/settings/user-api-keys#variables) |
66-
| `project` | No | Project identifier. Defaults to the Git repository name when available |
67-
| `version` | No | Release/version (for example, commit SHA). Defaults to current commit SHA when available |
64+
| `project-id` | Yes | PostHog project ID. Get it from your [project settings](https://app.posthog.com/settings/project#variables) |
65+
| `api-key` | Yes | Personal API key with error tracking write and organization read scopes. Get it from your [personal API key settings](https://app.posthog.com/settings/user-api-keys#variables) |
66+
| `release-name` | No | Release name. Defaults to the Git repository name when available |
67+
| `release-version` | No | Release version (for example, commit SHA). Defaults to current commit SHA when available |
6868
| `host` | No | PostHog host URL. Defaults to `https://us.posthog.com`. For EU cloud, set it to `https://eu.posthog.com` |
6969

7070
</div>
7171

72-
We recommend storing `env-id` and `cli-token` in GitHub Secrets (for example, `POSTHOG_ENV_ID` and `POSTHOG_CLI_TOKEN`).
72+
We recommend storing `project-id` and `api-key` in GitHub Secrets (for example, `POSTHOG_PROJECT_ID` and `POSTHOG_CLI_API_KEY`).
7373

7474
</Step>
7575

contents/docs/error-tracking/upload-source-maps/nextjs.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ showStepsToc: true
2525

2626
export default withPostHogConfig(nextConfig, {
2727
personalApiKey: process.env.POSTHOG_API_KEY, // Personal API Key
28-
envId: process.env.POSTHOG_ENV_ID, // Environment ID
28+
projectId: process.env.POSTHOG_PROJECT_ID, // Project ID
2929
host: process.env.NEXT_PUBLIC_POSTHOG_HOST, // (optional), defaults to https://us.posthog.com
3030
sourcemaps: { // (optional)
3131
enabled: true, // (optional) Enable sourcemaps generation and upload, default to true on production builds
32-
project: "my-application", // (optional) Project name, defaults to repository name
33-
version: "1.0.0", // (optional) Release version, defaults to current git commit
32+
releaseName: "my-application", // (optional) Release name, defaults to repository name
33+
releaseVersion: "1.0.0", // (optional) Release version, defaults to current git commit
3434
deleteAfterUpload: true, // (optional) Delete sourcemaps after upload, defaults to true
3535
},
3636
});
@@ -44,7 +44,7 @@ showStepsToc: true
4444
| Environment Variable | Description |
4545
| --- | --- |
4646
| `POSTHOG_API_KEY` | [Personal API key](https://app.posthog.com/settings/user-api-keys#variables) with at least `write` access on `error tracking` |
47-
| `POSTHOG_ENV_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/environment#variables) |
47+
| `POSTHOG_PROJECT_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/project#variables) |
4848
| `NEXT_PUBLIC_POSTHOG_HOST` | Your PostHog instance URL. Defaults to `https://us.posthog.com` |
4949

5050
</div>

contents/docs/error-tracking/upload-source-maps/rollup.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ showStepsToc: true
2727
plugins: [
2828
posthog({
2929
personalApiKey: process.env.POSTHOG_API_KEY, // Personal API Key
30-
envId: process.env.POSTHOG_ENV_ID, // Environment ID
30+
projectId: process.env.POSTHOG_PROJECT_ID, // Project ID
3131
host: process.env.POSTHOG_HOST, // (optional) defaults to https://us.i.posthog.com
3232
sourcemaps: { // (optional)
3333
enabled: true, // (optional) Enable sourcemaps generation and upload, defaults to true
34-
project: 'my-application', // (optional) Project name
35-
version: '1.0.0', // (optional) Release version
34+
releaseName: 'my-application', // (optional) Release name
35+
releaseVersion: '1.0.0', // (optional) Release version
3636
deleteAfterUpload: true, // (optional) Delete sourcemaps after upload, defaults to true
3737
},
3838
}),
@@ -47,7 +47,7 @@ showStepsToc: true
4747
| Environment Variable | Description |
4848
| --- | --- |
4949
| `POSTHOG_API_KEY` | [Personal API key](https://app.posthog.com/settings/user-api-keys#variables) with at least `write` access on `error tracking` |
50-
| `POSTHOG_ENV_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/environment#variables) |
50+
| `POSTHOG_PROJECT_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/project#variables) |
5151
| `POSTHOG_HOST` | (optional) Your PostHog instance URL. Defaults to `https://us.i.posthog.com` |
5252

5353
</div>

contents/docs/error-tracking/upload-source-maps/vite.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ showStepsToc: true
2727
plugins: [
2828
posthog({
2929
personalApiKey: process.env.POSTHOG_API_KEY, // Personal API Key
30-
envId: process.env.POSTHOG_ENV_ID, // Environment ID
30+
projectId: process.env.POSTHOG_PROJECT_ID, // Project ID
3131
host: process.env.POSTHOG_HOST, // (optional) defaults to https://us.i.posthog.com
3232
sourcemaps: { // (optional)
3333
enabled: true, // (optional) Enable sourcemaps generation and upload, defaults to true
34-
project: 'my-application', // (optional) Project name
35-
version: '1.0.0', // (optional) Release version
34+
releaseName: 'my-application', // (optional) Release name
35+
releaseVersion: '1.0.0', // (optional) Release version
3636
deleteAfterUpload: true, // (optional) Delete sourcemaps after upload, defaults to true
3737
},
3838
}),
@@ -47,7 +47,7 @@ showStepsToc: true
4747
| Environment variable | Description |
4848
| --- | --- |
4949
| `POSTHOG_API_KEY` | [Personal API key](https://app.posthog.com/settings/user-api-keys#variables) with at least `write` access on `error tracking` |
50-
| `POSTHOG_ENV_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/environment#variables) |
50+
| `POSTHOG_PROJECT_ID` | Project ID you can find in your [project settings](https://app.posthog.com/settings/project#variables) |
5151
| `POSTHOG_HOST` | (optional) Your PostHog instance URL. Defaults to `https://us.i.posthog.com` |
5252

5353
</div>

0 commit comments

Comments
 (0)