chore: load Subtester API keys from a gitignored local file - #1000
Draft
vegaro wants to merge 2 commits into
Draft
chore: load Subtester API keys from a gitignored local file#1000vegaro wants to merge 2 commits into
vegaro wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, beforePurchases.Start()configures the SDK) and, ifAssets/Tester/Resources/local-api-keys.jsonexists, 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.jsonand 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.shpasseslocal-api-keys.jsonare applied on a device build (log line[LocalApiKeys] Applied local RevenueCat API keysappears and offerings load)🤖 Generated with Claude Code