npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-encore-mock

v0.1.0

Published

Mock-first integration kit for the Encore React Native SDK — develop and demo retention offers, brand-sponsored partner trials, and entitlements with zero native dependencies. This is NOT the real SDK.

Readme

react-native-encore-mock

Mock-first integration kit for the Encore React Native SDK.

⚠️ This is not the real SDK. It's an in-memory mock that mirrors Encore's production API surface so you can build, demo, and test retention offers, brand-sponsored partner trials (Disney+, Netflix, Spotify…), and the entitlement flow with zero native dependencies — then switch to the real @tryencorekit/react-native by flipping one constant.

Why

The real Encore SDK is a native module — it needs a dev-client/native build and real campaigns. This kit lets your whole team develop the offer flow without any of that, and keeps going-live a one-line change.

Install

npm install react-native-encore-mock
# peer deps: react >=18, react-native >=0.70

Usage

Create one client and pass it to both the provider and your call sites:

// encore.ts — the single indirection in YOUR app
import { createMockEncore } from 'react-native-encore-mock';
// import realEncore from '@tryencorekit/react-native';

export const USE_MOCK = true;

export const Encore = USE_MOCK ? createMockEncore() : realEncore;
// App.tsx
import { MockEncoreProvider, useEncoreCallbacks } from 'react-native-encore-mock';
import { Encore } from './encore';
import { billing } from './billing';

function Root() {
  useEncoreCallbacks(Encore, {
    purchase: (productId) => billing.purchase(productId), // YOUR billing
    onResume: (placementId) => {/* resume original action */},
  });
  return <YourApp />;
}

export default function App() {
  return (
    <MockEncoreProvider client={Encore} apiKey="pk_your_api_key_here" logLevel="debug">
      <Root />
    </MockEncoreProvider>
  );
}
// anywhere — present an offer and react to the result
import { isGranted } from 'react-native-encore-mock';
import { Encore } from './encore';

const result = await Encore.placement('cancellation_flow').show();
if (isGranted(result)) {
  // 'granted' (paid) or 'completed' (brand-sponsored) → entitle the user
}

Offer types

The mock presents the two kinds Encore serves (configurable via createMockEncore({ offers })):

  • retention — a paid offer. Accepting runs your billing through onPurchaseRequestcompletePurchaseRequeststatus: 'granted'.
  • sponsored — Encore's Brand-Sponsored Premium Trials: a carousel of partner brands. Accepting charges nothing through your billing — it resolves to status: 'completed' (the brand sponsors it).

PlacementResult.status'granted' | 'completed' | 'not_granted' | 'dismissed' | 'no_offers'.

Customize offers/partners:

import { createMockEncore, DEFAULT_PARTNERS } from 'react-native-encore-mock';

const Encore = createMockEncore({
  offers: {
    cancellation_flow: {
      type: 'sponsored',
      placementId: 'cancellation_flow',
      campaignId: 'winback_2026',
      entitlement: 'subscription',
      title: 'Wait — a gift before you go',
      subtitle: 'A partner brand will sponsor your next months.',
      partners: DEFAULT_PARTNERS,
      dismissLabel: 'No thanks',
    },
  },
});

Going live

  1. npm install @tryencorekit/react-native (the real native SDK) + rebuild your native app / dev client.
  2. Set USE_MOCK = false and supply a real pk_ key.
  3. The real SDK renders the partner carousel natively; this kit is no longer used.

Your screen code (placement().show(), isGranted, callbacks) is identical in both modes.

API

  • createMockEncore(config?)MockEncoreClient
  • MockEncoreProvider{ client, apiKey, logLevel?, children }
  • useEncoreMockContext(){ apiKey, isReady }
  • useEncoreCallbacks(encore, { purchase, onResume?, onPurchaseComplete? })
  • isGranted(result) → boolean
  • DEFAULT_OFFERS, DEFAULT_PARTNERS
  • Types: EncoreClient, PlacementResult, MockOffer, PartnerTrial, …

License

MIT