diff --git a/example/README.md b/example/README.md index 425525fd..0161ae28 100644 --- a/example/README.md +++ b/example/README.md @@ -19,14 +19,18 @@ samples, guidance on mobile development, and a full API reference. Uploading sourcemaps needs [hog](https://posthog.com/docs/cli/migrating), PostHog's CLI. Install it with `npm install -g hog` or `brew install posthog/tap/hog`, then log in with `hog auth login`. -In GitHub Actions, install hog with the [PostHog/setup-hog](https://github.com/PostHog/setup-hog) action. The job can then upload with its OIDC token instead of a personal API key: run `hog ci setup --scope error_tracking:write` once in the repository, and give the job `permissions: id-token: write`. +In GitHub Actions, install hog with the [PostHog/setup-hog](https://github.com/PostHog/setup-hog) action. The job can then upload with its OIDC token instead of a personal API key: + +1. Run `hog ci setup --scope error_tracking:write` once in the repository, and have an organization admin approve the request. +2. Put the project ID that `hog ci setup` prints in `posthog.json` as `"projectId"`, or set `HOG_PROJECT_ID` (and `HOG_HOST` outside US Cloud) in the job. +3. Give the job `permissions: id-token: write`. ```bash # release mode rm -rf build/web flutter build web --source-maps hog error-tracking inject build/web --release-name posthog_flutter_example --release-version 1.0.0 --build 42 -# check the sourcemaps has chunk_id and release_id injected (*.js.map file) +# check the sourcemaps have chunk_id injected (*.js.map file). The release goes into the js file, not the map # check the js file has _posthogChunkIds injected (*.js file) # check the chunk_id and _posthogChunkIds match hog error-tracking upload build/web --kind js --release-name posthog_flutter_example --release-version 1.0.0 --build 42