@tinkerlandai/indiana-react-native 0.8.5 → 0.9.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 CHANGED
@@ -1,13 +1,13 @@
1
1
  # Indiana React Native SDK
2
2
 
3
- These examples use SDK 0.8.4 with `https://api.dev.tinker.cash` and that deployment's test App credentials (protocol 0.8). Check [environment state](../../docs/development-status.md) before changing targets. Set the API origin explicitly: the SDK default is production.
3
+ These examples target SDK 0.9.1 and protocol 0.9 at `https://api.tinker.cash`, using a Sandbox App and credentials issued by the production deployment. Sandbox still contains production data; do not reuse credentials from the separate test deployment. Confirm runtime readiness in [environment state](../../docs/development-status.md) before running them.
4
4
 
5
5
  Customer identity, holdings, entitlement checks and backend-mediated usage reporting for React Native 0.79+ / Metro 0.82+. This independent npm package uses Fetch and AbortController. It needs no DOM, WebView, native linking or React peer dependency. It does not include store purchases or Funnel native UI.
6
6
 
7
7
  Install the exact package version:
8
8
 
9
9
  ```sh
10
- npm install --save-exact @tinkerlandai/indiana-react-native@0.8.4
10
+ npm install --save-exact @tinkerlandai/indiana-react-native@0.9.1
11
11
  ```
12
12
 
13
13
  ```ts
@@ -15,7 +15,7 @@ import { createIndianaReactNative } from "@tinkerlandai/indiana-react-native";
15
15
 
16
16
  const indiana = createIndianaReactNative({
17
17
  scope: { projectId: "YOUR_APP_UUID", environment: "sandbox" },
18
- baseUrl: "https://api.dev.tinker.cash",
18
+ baseUrl: "https://api.tinker.cash",
19
19
  usageReporter: async (command) => {
20
20
  const response = await fetch("https://your-app.example/api/usage", {
21
21
  method: "POST",
@@ -30,8 +30,8 @@ const indiana = createIndianaReactNative({
30
30
  },
31
31
  });
32
32
 
33
- // Your backend issues a Customer Token for its authenticated app user.
34
- indiana.identify(customerToken);
33
+ // Your backend issues a complete Access/Refresh pair for its authenticated user.
34
+ indiana.identify(session);
35
35
  const holdings = await indiana.readHoldings();
36
36
  const entitlement = await indiana.checkEntitlement({
37
37
  requirement: {
@@ -50,6 +50,6 @@ indiana.reset();
50
50
 
51
51
  Never ship a Server Key in the app. `usageReporter` receives only a validated usage command. Your backend authenticates its own app session, selects the Customer and invokes the server SDK with its Server Key; return that SDK's complete usage response unchanged. Preserve the event's idempotency key across retries. The SDK validates response schema and App/environment and rejects results if identity changes while reporting. The callback owns its network timeout and retry policy.
52
52
 
53
- Credentials stay in memory. Call `reset()` at logout. Customer creation and token issuance belong on your backend. The existing `@tinkerlandai/indiana-sdk/react-native` subpath uses the same source implementation; install only one entry in an application.
53
+ Credentials stay in memory. Passing the complete session pair enables automatic refresh shared by concurrent requests; a bare Access Token requires host-managed renewal. Successful rotation preserves identity; a definitive refresh refusal or expired Refresh Token clears it and stops usage reporting until a new verified login. Call `reset()` at logout. Customer creation and token issuance belong on your backend. The existing `@tinkerlandai/indiana-sdk/react-native` subpath uses the same source implementation; install only one entry in an application.
54
54
 
55
55
  Package versions use the shared `sdk-vX.Y.Z` release. The package includes ESM, CommonJS and TypeScript declarations and a portable URL parser for React Native hosts whose built-in URL is incomplete. It does not replace application globals; its only runtime dependency is Zod. See the repository's [mobile integration guide](https://github.com/tinkerlandai/Indiana/blob/main/docs/mobile-sdk.md) and [release commands](https://github.com/tinkerlandai/Indiana/blob/main/docs/automated-releases.md).