Test mode
Test mode runs the whole chain (recording, event, signed webhook, event log) without an ad SDK or ad network. It is off by default.
npx @kasskeep/cli ads test-enable --id app_xxxFrom the client
Section titled “From the client”With testAds the SDK calls the test endpoint instead of your provider:
Kasskeep.configure({ apiKey, baseUrl, appUserId, ads: { rewardedProvider, adUnits, testAds: __DEV__ } });const r = await Kasskeep.ads.showRewarded({ adUnit: "revive", customData: "stage=3", testOutcome: "completed" });The underlying call, with the public key:
POST /v1/ads/test/rewardsX-Kasskeep-Key: pk_...
{"app_user_id": "6f1c...", "ad_unit": "revive", "reward_type": "coins", "reward_amount": 10, "custom_data": "stage=3", "outcome": "completed"}outcome:completed(default),skippedorfailed. Onlycompletedcreates anad.reward.network(optional):testby default. Withadmob,applovinorlevelplaythe reward takes that network’s shape and mapped ad unit id. Other values return400 unknown_ad_network.- Events have
environment: "test"andplatform: "test"; transaction ids start withtestad_. - With the default
rejectpolicy the ad unit name must be mapped (for that network whennetworkis set), otherwise422 unknown_ad_unit. - While test ads are off:
403 test_ads_disabled.
The response is {status, reward_event_id, ad_reward}.
From the CLI
Section titled “From the CLI”npx @kasskeep/cli ads simulate --id app_xxx --user <app_user_id> --ad-unit revive --reward-amount 10 --transaction-id replay-1 --network levelplayRun it twice with the same --transaction-id to see deduplication.
Turning on test ads, like the test store, also lets http://localhost:* origins through CORS.