Skip to content

fix(mobile): use projectToken instead of deprecated apiKey - #425

Merged
turnipdabeets merged 1 commit into
mainfrom
fix/ios-project-token
Oct 12, 2026
Merged

turnipdabeets merged 1 commit into
mainfrom
fix/ios-project-token

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

Problem

posthog-ios 3.56.0, posthog-android 3.72.0 and posthog-kmp 0.8.0 renamed the config's apiKey to projectToken and deprecated the old name. The Swift commandment, the KMP integration skill and the Swift/Android example apps still taught apiKey, so every wizard run on these platforms writes code that compiles with a deprecation warning and will break when the old name is removed in the next major.

Changes

  • iOS: commandments.yaml Swift rule, both Swift example apps and their READMEs use PostHogConfig(projectToken:host:). The swift example's posthog-ios requirement goes from 3.0.0 to 3.56.0 (first release with projectToken); Package.resolved refreshed 3.40.0 → 3.92.0. swift-xcodegen already required 3.64.1.
  • Android: example app and README use PostHogAndroidConfig(projectToken = ...); posthog-android bumped 3.31.0 → 3.72.1. The example's posthog.apiKey local property is renamed to posthog.projectToken to match.
  • KMP: description-kmp-docs-only.md uses PostHogConfig(projectToken = ...). It already tells the agent to install the latest version, so no pin to change.

The matching KMP line in the wizard's kmp-wizard-agent.ts is fixed in a companion wizard PR.

Testing

  • Both Swift example apps build for the iOS simulator with no deprecation warnings (swift-xcodegen via xcodegen generate).
  • Android example: ./gradlew :app:compileDebugKotlin passes with no warnings.

Related: PostHog/wizard#1439

🤖 Generated with Claude Code

posthog-ios 3.56.0, posthog-android 3.72.0 and posthog-kmp 0.8.0 renamed
the config's apiKey to projectToken and deprecated the old name. The Swift
commandment, the KMP integration skill and the Swift/Android example apps
still taught apiKey, so wizard runs wrote deprecated code.

Bump the example apps to SDK versions that have projectToken.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

@turnipdabeets
turnipdabeets merged commit e53674d into main Oct 12, 2026
18 checks passed
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