react-native-revnix 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/client.js +1 -1
- package/dist/esm/client.js +1 -1
- package/dist/esm/ui/RevnixPaywall.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/ui/RevnixPaywall.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/types.ts +1 -1
- package/src/ui/RevnixPaywall.tsx +1 -1
- package/src/version.ts +1 -1
- package/ui.js +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# revnix
|
|
1
|
+
# react-native-revnix
|
|
2
2
|
|
|
3
3
|
Revnix SDK for React Native / JavaScript. Pure TypeScript over the Revnix
|
|
4
4
|
`/v1` REST API, no native modules, no dependencies. Pairs with
|
|
5
5
|
`react-native-iap` (or any StoreKit 2 / Play Billing wrapper) for purchases.
|
|
6
6
|
Ships CJS + ESM (tree-shakeable); every request carries an
|
|
7
|
-
`X-Revnix-SDK: revnix
|
|
7
|
+
`X-Revnix-SDK: react-native-revnix/<version>` header (`SDK_VERSION` is exported).
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install revnix
|
|
12
|
+
npm install react-native-revnix
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Setup
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
|
-
import { Revnix } from "revnix
|
|
18
|
+
import { Revnix } from "react-native-revnix";
|
|
19
19
|
import { MMKV } from "react-native-mmkv";
|
|
20
20
|
|
|
21
21
|
const mmkv = new MMKV();
|
|
@@ -105,7 +105,7 @@ await Revnix.client.getCustomerId(); // rvx_anon_… until identified
|
|
|
105
105
|
await Revnix.client.logout(); // fresh anonymous customer
|
|
106
106
|
|
|
107
107
|
// server-side only (secret rvx_sk_ key, throws locally on a publishable key):
|
|
108
|
-
import { RevnixClient } from "revnix
|
|
108
|
+
import { RevnixClient } from "react-native-revnix";
|
|
109
109
|
|
|
110
110
|
const revnix = new RevnixClient({
|
|
111
111
|
apiKey: process.env.REVNIX_SECRET_KEY!, // rvx_sk_…
|
|
@@ -143,7 +143,7 @@ Set `appAccountToken` (iOS) / `obfuscatedAccountIdAndroid` to the Revnix
|
|
|
143
143
|
customer id when requesting the purchase, then register it:
|
|
144
144
|
|
|
145
145
|
```ts
|
|
146
|
-
import { purchaseInputFromIap, PurchaseBlockedError } from "revnix
|
|
146
|
+
import { purchaseInputFromIap, PurchaseBlockedError } from "react-native-revnix";
|
|
147
147
|
|
|
148
148
|
// in your purchaseUpdatedListener, before finishTransaction:
|
|
149
149
|
try {
|
|
@@ -674,7 +674,7 @@ and a `count` line under the CTA) and `config.offer` (struck-through anchor
|
|
|
674
674
|
price on the highlighted package, urgency line above the CTA).
|
|
675
675
|
|
|
676
676
|
```tsx
|
|
677
|
-
import { RevnixPaywall } from "revnix
|
|
677
|
+
import { RevnixPaywall } from "react-native-revnix/ui";
|
|
678
678
|
|
|
679
679
|
const { paywall, offering } = await Revnix.client.resolvePlacement("paywall_main");
|
|
680
680
|
if (!paywall || !offering) return null; // both are nullable; guard first
|
|
@@ -723,7 +723,7 @@ if (!paywall || !offering) return null; // both are nullable; guard first
|
|
|
723
723
|
`fontFamilyMap` maps design fonts to registered faces, `onDiagnostic`
|
|
724
724
|
receives render fallbacks when no `client` is passed.
|
|
725
725
|
- Unreleased (on `main`, not in 1.3.0): `Revnix.setLocale(tag)` (also
|
|
726
|
-
exported from `revnix
|
|
726
|
+
exported from `react-native-revnix/ui`) forces every designed paywall mounted
|
|
727
727
|
after the call into `tag`'s language; `Revnix.setLocale()` clears it. A
|
|
728
728
|
`locale` prop still wins for that one view. The links block's Restore,
|
|
729
729
|
Terms and Privacy labels follow the paywall's language.
|
package/dist/client.js
CHANGED
|
@@ -1592,7 +1592,7 @@ class RevnixClient {
|
|
|
1592
1592
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1593
1593
|
// L3: identify the SDK on EVERY request (reads included) so the
|
|
1594
1594
|
// backend can triage by version without depending on body fields.
|
|
1595
|
-
"X-Revnix-SDK": `revnix
|
|
1595
|
+
"X-Revnix-SDK": `react-native-revnix/${version_js_1.SDK_VERSION}`,
|
|
1596
1596
|
...(reportedBgFailures > 0
|
|
1597
1597
|
? { "X-Revnix-Bg-Failures": String(reportedBgFailures) }
|
|
1598
1598
|
: {}),
|
package/dist/esm/client.js
CHANGED
|
@@ -1589,7 +1589,7 @@ export class RevnixClient {
|
|
|
1589
1589
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1590
1590
|
// L3: identify the SDK on EVERY request (reads included) so the
|
|
1591
1591
|
// backend can triage by version without depending on body fields.
|
|
1592
|
-
"X-Revnix-SDK": `revnix
|
|
1592
|
+
"X-Revnix-SDK": `react-native-revnix/${SDK_VERSION}`,
|
|
1593
1593
|
...(reportedBgFailures > 0
|
|
1594
1594
|
? { "X-Revnix-Bg-Failures": String(reportedBgFailures) }
|
|
1595
1595
|
: {}),
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// An unrecognized template (config published by a newer dashboard) falls
|
|
13
13
|
// back to the classic structure instead of rendering nothing.
|
|
14
14
|
//
|
|
15
|
-
// Import from "revnix
|
|
15
|
+
// Import from "react-native-revnix/ui" — the core entrypoint stays free of
|
|
16
16
|
// react / react-native so non-RN consumers are unaffected.
|
|
17
17
|
import * as React from "react";
|
|
18
18
|
import { ActivityIndicator, Alert, Image, Linking, Pressable, ScrollView, StyleSheet, Text, View, } from "react-native";
|
package/dist/esm/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// L3: the single source of the SDK version inside src/. Must match
|
|
2
2
|
// package.json "version" — version.test.ts fails the build when they drift
|
|
3
3
|
// (they had: client.ts said 0.7.0 while the package shipped 0.9.0).
|
|
4
|
-
export const SDK_VERSION = "1.4.
|
|
4
|
+
export const SDK_VERSION = "1.4.2";
|
package/dist/types.d.ts
CHANGED
|
@@ -379,7 +379,7 @@ export interface PaywallConfig {
|
|
|
379
379
|
* When present RevnixPaywall renders THIS and the fields above act as the
|
|
380
380
|
* fallback for clients that predate block rendering — so an older app
|
|
381
381
|
* keeps showing a sane classic screen instead of nothing. Typed as the
|
|
382
|
-
* block document in "revnix
|
|
382
|
+
* block document in "react-native-revnix/ui"; the core entrypoint keeps it opaque
|
|
383
383
|
* so non-UI consumers pull in no renderer types. */
|
|
384
384
|
blocks?: unknown;
|
|
385
385
|
}
|
package/dist/ui/RevnixPaywall.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// An unrecognized template (config published by a newer dashboard) falls
|
|
14
14
|
// back to the classic structure instead of rendering nothing.
|
|
15
15
|
//
|
|
16
|
-
// Import from "revnix
|
|
16
|
+
// Import from "react-native-revnix/ui" — the core entrypoint stays free of
|
|
17
17
|
// react / react-native so non-RN consumers are unaffected.
|
|
18
18
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
19
|
if (k2 === undefined) k2 = k;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.4.
|
|
1
|
+
export declare const SDK_VERSION = "1.4.2";
|
package/dist/version.js
CHANGED
|
@@ -4,4 +4,4 @@ exports.SDK_VERSION = void 0;
|
|
|
4
4
|
// L3: the single source of the SDK version inside src/. Must match
|
|
5
5
|
// package.json "version" — version.test.ts fails the build when they drift
|
|
6
6
|
// (they had: client.ts said 0.7.0 while the package shipped 0.9.0).
|
|
7
|
-
exports.SDK_VERSION = "1.4.
|
|
7
|
+
exports.SDK_VERSION = "1.4.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-revnix",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Revnix SDK for React, React Native & Next.js: purchase registration, entitlements, identity, and placements over the Revnix /v1 API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
package/src/client.ts
CHANGED
|
@@ -1922,7 +1922,7 @@ export class RevnixClient {
|
|
|
1922
1922
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1923
1923
|
// L3: identify the SDK on EVERY request (reads included) so the
|
|
1924
1924
|
// backend can triage by version without depending on body fields.
|
|
1925
|
-
"X-Revnix-SDK": `revnix
|
|
1925
|
+
"X-Revnix-SDK": `react-native-revnix/${SDK_VERSION}`,
|
|
1926
1926
|
...(reportedBgFailures > 0
|
|
1927
1927
|
? { "X-Revnix-Bg-Failures": String(reportedBgFailures) }
|
|
1928
1928
|
: {}),
|
package/src/types.ts
CHANGED
|
@@ -427,7 +427,7 @@ export interface PaywallConfig {
|
|
|
427
427
|
* When present RevnixPaywall renders THIS and the fields above act as the
|
|
428
428
|
* fallback for clients that predate block rendering — so an older app
|
|
429
429
|
* keeps showing a sane classic screen instead of nothing. Typed as the
|
|
430
|
-
* block document in "revnix
|
|
430
|
+
* block document in "react-native-revnix/ui"; the core entrypoint keeps it opaque
|
|
431
431
|
* so non-UI consumers pull in no renderer types. */
|
|
432
432
|
blocks?: unknown;
|
|
433
433
|
}
|
package/src/ui/RevnixPaywall.tsx
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// An unrecognized template (config published by a newer dashboard) falls
|
|
13
13
|
// back to the classic structure instead of rendering nothing.
|
|
14
14
|
//
|
|
15
|
-
// Import from "revnix
|
|
15
|
+
// Import from "react-native-revnix/ui" — the core entrypoint stays free of
|
|
16
16
|
// react / react-native so non-RN consumers are unaffected.
|
|
17
17
|
|
|
18
18
|
import * as React from "react";
|
package/src/version.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// L3: the single source of the SDK version inside src/. Must match
|
|
2
2
|
// package.json "version" — version.test.ts fails the build when they drift
|
|
3
3
|
// (they had: client.ts said 0.7.0 while the package shipped 0.9.0).
|
|
4
|
-
export const SDK_VERSION = "1.4.
|
|
4
|
+
export const SDK_VERSION = "1.4.2";
|
package/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Subpath entry: require("revnix
|
|
1
|
+
// Subpath entry: require("react-native-revnix/ui"). Kept at the package root
|
|
2
2
|
// so every resolver (Metro, Node, TS "node" moduleResolution) finds it
|
|
3
3
|
// without an "exports" map. UI pulls in react/react-native peers — keep it
|
|
4
4
|
// out of the core index so pure-JS consumers never load them.
|