> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# Remote Config `enableIAP`

`enableIAP` is a boolean Remote Config key. It defaults to `true`.

**What it controls:** whether players can **buy single songs** (the weekly song deal and the
"buy this song" price pill).

**What it does not control:**

- **The No Ads package.** As of 2026-11-05 the remove-ads promo card in the song list (a tap
  buys the package straight away) shows whatever the flag says. It stops showing only once the player owns
  no-ads (`adsRemoved`). This change keeps the No Ads package available while the IAP rework is
  in progress.
- **Any subscription paywall.** This includes the onboarding, first-song, replay, video,
  session and home-return paywalls. See [onboarding.md](/docs/features/onboarding.md).

## Where it is defined

| What                                  | Where                                                                                                                                                                                                                        |
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Schema and default (`true`)           | [`remote-config.schema.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/core/config/remote-config.schema.ts) — `RemoteConfigSchema.enableIAP`                               |
| Firebase key mapping and boolean read | [`firebase-remote-config.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/core/config/firebase-remote-config.ts) — `FIREBASE_RC_DEFAULTS`, `RC_KEY_MAP`, `readRemoteValues` |
| Console template                      | [`firebase-remote-config.template.json`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/docs/firebase-remote-config.template.json)                                                 |
| Runtime value                         | `useRemoteConfigStore((s) => s.config.enableIAP)` (reactive), or `getSongsServices().remoteConfig().enableIAP` inside the songs flow store                                                                                   |

There is no `EXPO_PUBLIC_RC_*` dev override for this key ([`dev-overrides.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/core/config/dev-overrides.ts)).

## What reads it

All of these are **single-song IAP** behaviour.

| Reader                                                                                                                                                                                                                   | Effect when `enableIAP` is `false`                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`useSongLockState.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/songs/hooks/useSongLockState.ts) — `lockStateToMonetisationFlags` / `toTrackWithLockState` | A `LOCKED_IAP` song is shown as a premium (VIP) song: `isPremium: true`, `isIAP: false`. Owned IAP songs stay playable.                                                                               |
| [`song-row-view-model.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/songs/logic/song-row-view-model.ts) — `iapFeatureProductId`, `resolveLearnCta`          | No "Weekly song deal" ribbon or buy pill. The row shows the Premium CTA, and the video Play / Learn pills come back.                                                                                  |
| [`song-list-projection.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/songs/logic/song-list-projection.ts) — `projectListedTracks`, `buildSongListItems`     | Applies the two rows above to every listed song. It does **not** affect the promo row.                                                                                                                |
| [`song-list-view.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/songs/song-list-view.ts)                                                                     | Re-projects the list when the value changes in realtime. Offerings are fetched for IAP rows only while the flag is on. The no-ads price is still fetched whenever the promo can show (`!adsRemoved`). |
| [`song-list-flow-store.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/songs/song-list-flow-store.ts) — `readListAtTap`, `rowsBecameViewable`                 | At tap time, uses the same projection as the rows, so `resolveLearnPress` matches what is on screen. When an IAP row scrolls into view, no offerings are prefetched.                                  |
| [`song-press-decisions.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/songs/logic/song-press-decisions.ts) — `resolveLearnPress`                             | Uses the same Learn CTA as the row.                                                                                                                                                                   |
| [`useSessionResultSuggestions.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/piano/hooks/useSessionResultSuggestions.ts)                                     | Song suggestions on the result screen (Game and Learn) show IAP songs as premium.                                                                                                                     |

## What must not read it

These are enforced by [`paywalls-ignore-enable-iap.test.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/features/paywall/__tests__/paywalls-ignore-enable-iap.test.ts):

- **Every subscription paywall:** the first-song, video, play/tutorial result, `PaywallHost`,
  `SessionPaywallHost` and onboarding paywalls.
- **The No Ads package:**
  - `buyRemoveAds` in the flow store (no flag check before buying)
  - the promo gate in `buildSongListItems` (`!adsRemoved && rows.length > 0`)
  - `RemoveAdsPromoCard`

Ad gating does not read the flag either. The gate is asked per format
([`entitlement-gate.ts`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/src/core/ads/entitlement-gate.ts)):

- interstitial, App Open and banner close on `isPremium || adsRemoved`;
- rewarded closes on `isPremium` only. A No Ads purchase keeps rewarded videos, so songs and
  Learn hearts still unlock by video (PM 2026-11-09).

## History

- **Before 2026-11-05:** with `enableIAP` off, the No Ads package was hidden as well. The promo
  row was left out, its paywall would not open, and its price was not fetched.
- **2026-11-05:** the No Ads package no longer follows the flag, ahead of the IAP rework. If
  the rework needs its own switch for the No Ads package, add a separate Remote Config key
  rather than reusing `enableIAP`.

***

<small>Source: [`docs/remote-config-enable-iap.md`](https://github.com/leapgame/leap-sim-piano/blob/f794b594016038c483e2d20b6af56aea0ae1b982/docs/remote-config-enable-iap.md)</small>
