⚠️ Demonstration mock — react-native-encore-mock is not the real Encore SDK and will be deleted after the demo.
Overview

react-native-encore-mock

Documentation for react-native-encore-mock — a mock-first integration kit for Encore, the retention-offer & entitlement SDK (@tryencorekit/react-native).

It lets you build, demo, and test Encore’s offer flow — retention discounts, brand-sponsored partner trials, and entitlements — with zero native dependencies, then switch to the real SDK by flipping one constant.

⚠️

This is a temporary mock for demonstration only. react-native-encore-mock is not the real Encore SDK — it’s an in-memory stand-in built for a demo, and it will be deleted after the demonstration. Don’t build anything that depends on it.

The working example throughout these docs is Hotspot Havoc, an Expo React Native game that consumes the package.

What is Encore?

Encore presents targeted offers at key moments and tracks the entitlements that result:

  • A user starts a cancellation flow → Encore presents brand-sponsored offers (Disney+, Netflix, Spotify…) where a partner pays for the user’s subscription — Encore’s Brand-Sponsored Premium Trials.
  • A user hits a feature paywall → Encore offers a paid trial or discount.

Your app asks Encore to present an offer at a placement; Encore decides what (if anything) to show and reports the result. Encore never charges the user — for paid offers your billing library (RevenueCat, react-native-iap, StoreKit, Play Billing) performs the purchase; for sponsored offers the partner brand foots the bill.

What the package gives you

ExportPurpose
createMockEncore(config?)In-memory client implementing Encore’s full surface
MockEncoreProviderHosts the offer UI — retention sheet + sponsored partner carousel
useEncoreCallbacks(encore, opts)Registers the 3 callbacks; enforces the completePurchaseRequest rule
isGranted(result)true for a paid (granted) or sponsored (completed) win
DEFAULT_OFFERS, DEFAULT_PARTNERSReady-made offer + partner presets
TypesEncoreClient, PlacementResult, MockOffer, PartnerTrial, …

The flow you wire is the real one:

<MockEncoreProvider> → Encore.identify() → useEncoreCallbacks()
   → Encore.placement(id).show() → isGranted(result) → entitle the user

Going live is a one-line change — flip USE_MOCK and the same code talks to the real native @tryencorekit/react-native.

Where to go next