@tenthbilling/expo 0.0.0-stage → 0.1.1

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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -2
  3. package/android/build.gradle +23 -0
  4. package/android/src/main/AndroidManifest.xml +2 -0
  5. package/android/src/main/java/com/tenthbilling/expo/TenthStoreModule.kt +669 -0
  6. package/app.plugin.js +3 -0
  7. package/dist/api/client.d.ts +107 -0
  8. package/dist/api/client.js +139 -0
  9. package/dist/api/types.d.ts +17 -0
  10. package/dist/api/types.js +1 -0
  11. package/dist/cache.d.ts +23 -0
  12. package/dist/cache.js +40 -0
  13. package/dist/errors.d.ts +18 -0
  14. package/dist/errors.js +42 -0
  15. package/dist/generated/openapi.d.ts +3208 -0
  16. package/dist/generated/openapi.js +1 -0
  17. package/dist/identity.d.ts +35 -0
  18. package/dist/identity.js +92 -0
  19. package/dist/index.d.ts +12 -0
  20. package/dist/index.js +10 -0
  21. package/dist/keys.d.ts +8 -0
  22. package/dist/keys.js +14 -0
  23. package/dist/native/module.d.ts +12 -0
  24. package/dist/native/module.js +14 -0
  25. package/dist/native/spec.d.ts +166 -0
  26. package/dist/native/spec.js +1 -0
  27. package/dist/products.d.ts +32 -0
  28. package/dist/products.js +213 -0
  29. package/dist/react/Paywall.d.ts +28 -0
  30. package/dist/react/Paywall.js +19 -0
  31. package/dist/react/TenthProvider.d.ts +11 -0
  32. package/dist/react/TenthProvider.js +23 -0
  33. package/dist/react/context.d.ts +4 -0
  34. package/dist/react/context.js +8 -0
  35. package/dist/react/hooks.d.ts +48 -0
  36. package/dist/react/hooks.js +68 -0
  37. package/dist/react/present.d.ts +15 -0
  38. package/dist/react/present.js +47 -0
  39. package/dist/react/usePaywall.d.ts +12 -0
  40. package/dist/react/usePaywall.js +109 -0
  41. package/dist/storage/storage.d.ts +14 -0
  42. package/dist/storage/storage.js +63 -0
  43. package/dist/storage/storage.web.d.ts +4 -0
  44. package/dist/storage/storage.web.js +35 -0
  45. package/dist/store/apple.d.ts +19 -0
  46. package/dist/store/apple.js +127 -0
  47. package/dist/store/context.d.ts +46 -0
  48. package/dist/store/context.js +21 -0
  49. package/dist/store/google.d.ts +22 -0
  50. package/dist/store/google.js +145 -0
  51. package/dist/store/preview.d.ts +16 -0
  52. package/dist/store/preview.js +68 -0
  53. package/dist/stripe/appearance.d.ts +47 -0
  54. package/dist/stripe/appearance.js +44 -0
  55. package/dist/stripe/flows.d.ts +23 -0
  56. package/dist/stripe/flows.js +145 -0
  57. package/dist/stripe/payment-sheet.d.ts +1 -0
  58. package/dist/stripe/payment-sheet.js +24 -0
  59. package/dist/stripe/sheet-registry.d.ts +16 -0
  60. package/dist/stripe/sheet-registry.js +7 -0
  61. package/dist/stripe/web-step.d.ts +10 -0
  62. package/dist/stripe/web-step.js +4 -0
  63. package/dist/stripe/web-step.web.d.ts +4 -0
  64. package/dist/stripe/web-step.web.js +55 -0
  65. package/dist/tenth.d.ts +125 -0
  66. package/dist/tenth.js +329 -0
  67. package/dist/updates.d.ts +15 -0
  68. package/dist/updates.js +30 -0
  69. package/expo-module.config.json +9 -0
  70. package/ios/CountryCodes.swift +52 -0
  71. package/ios/TenthBilling.podspec +31 -0
  72. package/ios/TenthStoreExceptions.swift +88 -0
  73. package/ios/TenthStoreMapping.swift +108 -0
  74. package/ios/TenthStoreModule.swift +213 -0
  75. package/ios/TenthStoreRecords.swift +105 -0
  76. package/package.json +94 -3
  77. package/plugin/withTenth.js +249 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Apps LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,42 @@
1
- # Temporary Holding Version
1
+ # @tenthbilling/expo
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Subscriptions, one-time purchases and credits for Expo apps: StoreKit 2 on iOS, Play Billing on Android and Stripe on the web, all verified by Tenth's server. The setup takes three steps, which the [quickstart](https://tenthbilling.com/docs/quickstart) walks through.
4
+
5
+ ```sh
6
+ npx expo install @tenthbilling/expo expo-secure-store expo-crypto expo-constants expo-web-browser lucide-react-native react-native-svg
7
+ ```
8
+
9
+ ```tsx
10
+ <TenthProvider apiKey="tenth_test_pk_..." getCustomerToken={getToken}>
11
+ <Home />
12
+ </TenthProvider>;
13
+
14
+ function Home() {
15
+ const pro = useEntitlement('pro');
16
+ return pro.active ? <ProFeature /> : <Paywall />;
17
+ }
18
+ ```
19
+
20
+ ## What's in the package
21
+
22
+ - **Components:** `TenthProvider`, `Paywall`, `Gate`.
23
+ - **Hooks:** `useEntitlement`, `useCustomer`, `useCredits`, `useOffering`, `usePaywall` (headless), `useTenth`.
24
+ - **Imperative calls:** `presentPaywall`, `presentPaywallIfNeeded`.
25
+ - **`@tenthbilling/expo/payment-sheet`:** import it to sell with Stripe PaymentSheet inside native apps (offerings with the `in_app_stripe` path). It needs `@stripe/stripe-react-native`.
26
+ - **The config plugin** (`plugins: ["@tenthbilling/expo"]`) takes these options:
27
+ - `googlePlayBilling`: defaults to true;
28
+ - `storeKitConfig`: a `.storekit` file for local testing in Xcode.
29
+
30
+ ## How it behaves
31
+
32
+ - **Keys:** only publishable keys. A secret key throws.
33
+ - **Purchases:**
34
+ - iOS transactions are finished only after Tenth accepts them.
35
+ - Play purchases are acknowledged and consumed by Tenth's server, never by the device.
36
+ - A purchase that can't reach Tenth is retried on the next launch.
37
+ - **State:** the last state is cached in the Keychain or Keystore (`localStorage` on web) and shown on launch. Cached access lasts at most 72 hours offline (`offlineGraceHours`), and never past its expiry. The SDK refreshes on launch, on foreground, after purchases, and by polling after Stripe payments; call `refresh()` to refresh any time.
38
+ - **Preview mode:** used in Expo Go, or with `preview` set. Purchases are simulated on the device, and refused with a live key.
39
+
40
+ Gating on the device is for UI. Anything that must not be bypassed belongs on your server, behind `@tenthbilling/node`.
41
+
42
+ Full reference: https://tenthbilling.com/docs/expo
@@ -0,0 +1,23 @@
1
+ plugins {
2
+ id 'com.android.library'
3
+ id 'expo-module-gradle-plugin'
4
+ }
5
+
6
+ group = 'com.tenthbilling'
7
+ version = '0.0.0'
8
+
9
+ android {
10
+ namespace "com.tenthbilling.expo"
11
+ defaultConfig {
12
+ versionCode 1
13
+ versionName '0.0.0'
14
+ }
15
+ }
16
+
17
+ dependencies {
18
+ // Play Billing Library, pinned. 8.x: enableAutoServiceReconnection, QueryProductDetailsResult,
19
+ // PendingPurchasesParams.enableOneTimeProducts. Its manifest contributes the BILLING permission
20
+ // and Play's billing activity; the config plugin also ensures the permission.
21
+ // The module never acknowledges or consumes purchases: Tenth's server does.
22
+ implementation "com.android.billingclient:billing:8.0.0"
23
+ }
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>