Skip to content

chore: load Subtester API keys from a gitignored local file - #1000

Draft
vegaro wants to merge 2 commits into
mainfrom
cesar/subtester-local-api-keys
Draft

chore: load Subtester API keys from a gitignored local file#1000
vegaro wants to merge 2 commits into
mainfrom
cesar/subtester-local-api-keys

Conversation

@vegaro

@vegaro vegaro commented Jul 23, 2026

Copy link
Copy Markdown
Member

What changed

Until now, testing Subtester meant typing real API keys into the Purchases component in the committed Main scene, which permanently dirties the scene diff and makes it easy to commit a key by accident.

This adds LocalApiKeys, a small static class that runs at scene load (after Awake, before Purchases.Start() configures the SDK) and, if Assets/Tester/Resources/local-api-keys.json exists, injects its keys into the Purchases component's public key fields. If the file is absent it does nothing, so the inspector workflow still works. Key values are never logged.

The JSON file and its folder are gitignored; a committed template lives at Subtester/local-api-keys.example.json and the README documents both options. No SDK code or scene changes — the injection uses the existing public fields.

Stacked on #999 (uses the Assets/Tester/ layout introduced there); will retarget to main once that merges.

Verification

  • scripts/check-meta-files.sh passes
  • Keys from local-api-keys.json are applied on a device build (log line [LocalApiKeys] Applied local RevenueCat API keys appears and offerings load)
  • Without the file, inspector-configured keys still work
  • CI Subtester build jobs pass

🤖 Generated with Claude Code

vegaro and others added 2 commits July 23, 2026 12:17
Remove dead uGUI-era assets (BuyButton.prefab, BillingMode.json) and an
orphaned StreamingAssets.meta, consolidate stray Scripts/ and 'UI Toolkit'/
folders under Assets/Tester/, and rewrite the README to describe the
current UI Toolkit-based tester app.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add LocalApiKeys, which runs at scene load (before Purchases configures)
and injects API keys from Assets/Tester/Resources/local-api-keys.json into
the Purchases component if that file exists. The file and its folder are
gitignored, with a committed template at Subtester/local-api-keys.example.json,
so devs no longer type keys into the committed Main scene where they dirty
the diff and risk being committed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vegaro vegaro added the pr:other Changes to our CI configuration files and scripts label Jul 23, 2026
Base automatically changed from cesar/unity-local-dev-improvements to main July 23, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:other Changes to our CI configuration files and scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant