Skip to content

Commit 26ea636

Browse files
authored
Drop "API" — use "project token" not "project API token"
Per review feedback: PostHog's term is "project token", not "project API token". Drops the "API" word across the omnibus instrument-* skills, mcp-analytics, and the Rails commandment. The MCP `api_token` field name in code is unchanged, and "personal API key" references are untouched. Generated-By: PostHog Code Task-Id: 870391f2-b0c5-4a20-8534-7dd9607b7a48
1 parent 6ecb102 commit 26ea636

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

context/commandments.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ commandments:
170170
- "capture_exception takes POSITIONAL args: PostHog.capture_exception(exception, distinct_id, additional_properties) — do NOT use keyword args"
171171
- "Define posthog_distinct_id on the User model for automatic user association in error reports — posthog-rails auto-detects by trying: posthog_distinct_id, distinct_id, id, pk, uuid (in order)"
172172
- "For ActiveJob user association, use the class-level DSL `posthog_distinct_id ->(user) { user.email }` or pass user_id: in a hash argument"
173-
- Store the project API token in Rails credentials or environment variables, never hardcode
173+
- Store the project token in Rails credentials or environment variables, never hardcode
174174
- "For frontend tracking alongside posthog-rails, add the posthog-js snippet to the layout template — posthog-js handles pageviews, session replay, and client-side errors while posthog-ruby handles backend events, server errors, feature flags, and background jobs"
175175

176176
hogql:

context/skills/mcp-analytics/description.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ Resolve `distinct_id` / `session_id` from whatever auth/session the dispatcher a
207207

208208
### STEP 5: Wire up credentials
209209

210-
- Check existing env files (`.env`, `.env.local`, etc.) for a PostHog project API token. If a valid `phc_…` token and host are already set, reference those and skip the rest of this step.
211-
- If the token is missing, use the PostHog MCP server's `projects-get` tool to fetch the project's `api_token`. If multiple projects come back, ask the user which to use. If the MCP server isn't connected, ask the user for their project API token directly.
210+
- Check existing env files (`.env`, `.env.local`, etc.) for a PostHog project token. If a valid `phc_…` token and host are already set, reference those and skip the rest of this step.
211+
- If the token is missing, use the PostHog MCP server's `projects-get` tool to fetch the project's `api_token`. If multiple projects come back, ask the user which to use. If the MCP server isn't connected, ask the user for their project token directly.
212212
- Host: `https://us.i.posthog.com` for US Cloud, `https://eu.i.posthog.com` for EU Cloud.
213213
- Write `POSTHOG_PROJECT_TOKEN` and `POSTHOG_HOST` to the appropriate env file and reference them in code (`process.env.*` in JS, `os.environ[...]` in Python) — never hardcode the token.
214214

@@ -251,7 +251,7 @@ The PostHog client batches events; the user owns the client's lifecycle.
251251

252252
- **One server, one wrapper.** `instrument()` is idempotent; don't call it twice on the same server.
253253
- **Module-scope client.** Construct the `PostHog` / `Posthog` / `PostHogMCP` client once, not per request.
254-
- **Env, never hardcode.** The project API token and host come from environment variables.
254+
- **Env, never hardcode.** The project token and host come from environment variables.
255255
- **Additive only.** Don't change tool behavior or restructure the server — just wrap/capture.
256256
- **Don't break STDIO.** No `console.*` (JS) or `print()` (Python) on STDIO transports; use a `logger` instead.
257257
- **Pin the beta SDK** and tell the user it's pre-1.0. (Python: `posthog.mcp` ships inside `posthog`; pin `posthog>=7.21`.)

context/skills/omnibus/instrument-error-tracking/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ STEP 6: Upload source maps (frontend/mobile only).
3838

3939
STEP 7: Set up environment variables.
4040
- Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step.
41-
- If the PostHog project API token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API token instead.
41+
- If the PostHog project token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.
4242
- For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud.
4343
- Write these values to the appropriate env file using the framework's naming convention.
4444
- Reference these environment variables in code instead of hardcoding them.

context/skills/omnibus/instrument-feature-flags/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ STEP 5: Instrument the feature.
3535

3636
STEP 6: Set up environment variables.
3737
- Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step.
38-
- If the PostHog project API token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API token instead.
38+
- If the PostHog project token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.
3939
- For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud.
4040
- Write these values to the appropriate env file using the framework's naming convention.
4141
- Reference these environment variables in code instead of hardcoding them.

context/skills/omnibus/instrument-integration/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ STEP 5: Identify users.
3232

3333
STEP 6: Set up environment variables.
3434
- Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step.
35-
- If the PostHog project API token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API token instead.
35+
- If the PostHog project token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.
3636
- For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud.
3737
- Write these values to the appropriate env file (e.g. `.env.local` for Next.js, `.env` for others) using the framework's naming convention.
3838
- Reference these environment variables in code instead of hardcoding them.

context/skills/omnibus/instrument-llm-analytics/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ STEP 5: Link to users.
3636

3737
STEP 6: Set up environment variables.
3838
- Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step.
39-
- If the PostHog project API token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API token instead.
39+
- If the PostHog project token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.
4040
- For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud.
4141
- Write these values to the appropriate env file using the framework's naming convention.
4242
- Reference these environment variables in code instead of hardcoding them.

context/skills/omnibus/instrument-logs/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ STEP 6: Add structured properties.
3939

4040
STEP 7: Set up environment variables.
4141
- Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step.
42-
- If the PostHog project API token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API token instead.
42+
- If the PostHog project token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.
4343
- For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud.
4444
- For the OpenTelemetry endpoint, use `https://us.i.posthog.com/v1` (US) or `https://eu.i.posthog.com/v1` (EU).
4545
- Write these values to the appropriate env file using the framework's naming convention.

context/skills/omnibus/instrument-product-analytics/description.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ STEP 8: Add error tracking.
4747

4848
STEP 9: Set up environment variables.
4949
- Check if the project already has PostHog environment variables configured (e.g. in `.env`, `.env.local`, or framework-specific env files). If valid values already exist, skip this step.
50-
- If the PostHog project API token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project API token instead.
50+
- If the PostHog project token is missing, use the PostHog MCP server's `projects-get` tool to retrieve the project's `api_token`. If multiple projects are returned, ask the user which project to use. If the MCP server is not connected or not authenticated, ask the user for their PostHog project token instead.
5151
- For the PostHog host URL, use `https://us.i.posthog.com` for US Cloud or `https://eu.i.posthog.com` for EU Cloud.
5252
- Write these values to the appropriate env file using the framework's naming convention.
5353
- Reference these environment variables in code instead of hardcoding them.

0 commit comments

Comments
 (0)