expo-iap 3.3.0-rc.2 → 3.3.0-rc.3

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.
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1765604754844" clover="3.2.0">
3
- <project timestamp="1765604754844" name="All files">
2
+ <coverage generated="1765640733669" clover="3.2.0">
3
+ <project timestamp="1765640733669" name="All files">
4
4
  <metrics statements="476" coveredstatements="448" conditionals="262" coveredconditionals="228" methods="100" coveredmethods="80" elements="838" coveredelements="756" complexity="0" loc="476" ncloc="476" packages="3" files="5" classes="5"/>
5
5
  <package name="src">
6
6
  <metrics statements="209" coveredstatements="203" conditionals="110" coveredconditionals="100" methods="43" coveredmethods="34"/>
@@ -131,7 +131,7 @@
131
131
  <div class='footer quiet pad2 space-top1 center small'>
132
132
  Code coverage generated by
133
133
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
134
- at 2025-12-13T05:45:54.833Z
134
+ at 2025-12-13T15:45:33.658Z
135
135
  </div>
136
136
  <script src="prettify.js"></script>
137
137
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2025-12-13T05:45:54.833Z
104
+ at 2025-12-13T15:45:33.658Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
@@ -2554,7 +2554,7 @@ export {<span class="fstat-no" title="function not covered" >ExpoIapConsole}</sp
2554
2554
  <div class='footer quiet pad2 space-top1 center small'>
2555
2555
  Code coverage generated by
2556
2556
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
2557
- at 2025-12-13T05:45:54.833Z
2557
+ at 2025-12-13T15:45:33.658Z
2558
2558
  </div>
2559
2559
  <script src="../prettify.js"></script>
2560
2560
  <script>
@@ -1045,7 +1045,7 @@ export const createBillingProgramReportingDetailsAndroid = async (
1045
1045
  <div class='footer quiet pad2 space-top1 center small'>
1046
1046
  Code coverage generated by
1047
1047
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1048
- at 2025-12-13T05:45:54.833Z
1048
+ at 2025-12-13T15:45:33.658Z
1049
1049
  </div>
1050
1050
  <script src="../../prettify.js"></script>
1051
1051
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2025-12-13T05:45:54.833Z
119
+ at 2025-12-13T15:45:33.658Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
@@ -1270,7 +1270,7 @@ export const presentExternalPurchaseLinkIOS: MutationField&lt;
1270
1270
  <div class='footer quiet pad2 space-top1 center small'>
1271
1271
  Code coverage generated by
1272
1272
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1273
- at 2025-12-13T05:45:54.833Z
1273
+ at 2025-12-13T15:45:33.658Z
1274
1274
  </div>
1275
1275
  <script src="../../prettify.js"></script>
1276
1276
  <script>
@@ -268,7 +268,7 @@ export const ExpoIapConsole = createConsole();
268
268
  <div class='footer quiet pad2 space-top1 center small'>
269
269
  Code coverage generated by
270
270
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
271
- at 2025-12-13T05:45:54.833Z
271
+ at 2025-12-13T15:45:33.658Z
272
272
  </div>
273
273
  <script src="../../prettify.js"></script>
274
274
  <script>
@@ -1126,7 +1126,7 @@ export function getUserFriendlyErrorMessage(error: ErrorLike): string {
1126
1126
  <div class='footer quiet pad2 space-top1 center small'>
1127
1127
  Code coverage generated by
1128
1128
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
1129
- at 2025-12-13T05:45:54.833Z
1129
+ at 2025-12-13T15:45:33.658Z
1130
1130
  </div>
1131
1131
  <script src="../../prettify.js"></script>
1132
1132
  <script>
@@ -116,7 +116,7 @@
116
116
  <div class='footer quiet pad2 space-top1 center small'>
117
117
  Code coverage generated by
118
118
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
119
- at 2025-12-13T05:45:54.833Z
119
+ at 2025-12-13T15:45:33.658Z
120
120
  </div>
121
121
  <script src="../../prettify.js"></script>
122
122
  <script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-iap",
3
- "version": "3.3.0-rc.2",
3
+ "version": "3.3.0-rc.3",
4
4
  "description": "In App Purchase module in Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,6 +1,12 @@
1
1
  import { ConfigPlugin } from 'expo/config-plugins';
2
2
  import { withIosAlternativeBilling, type IOSAlternativeBillingConfig } from './withIosAlternativeBilling';
3
3
  export interface ExpoIapPluginOptions {
4
+ /**
5
+ * IAPKit API key for server-side receipt verification.
6
+ * Get your API key from https://iapkit.com
7
+ * This will be available via `Constants.expoConfig?.extra?.iapkitApiKey`
8
+ */
9
+ iapkitApiKey?: string;
4
10
  /** Local development path for OpenIAP library */
5
11
  localPath?: string | {
6
12
  ios?: string;
@@ -46,11 +52,8 @@ export interface ExpoIapPluginOptions {
46
52
  */
47
53
  horizonAppId?: string;
48
54
  };
49
- /** @deprecated Use ios.alternativeBilling instead */
50
- iosAlternativeBilling?: IOSAlternativeBillingConfig;
51
- /** @deprecated Use android.horizonAppId instead */
52
- horizonAppId?: string;
53
55
  }
54
- export { withIosAlternativeBilling };
56
+ declare const withIap: ConfigPlugin<ExpoIapPluginOptions | void>;
57
+ export { withIosAlternativeBilling, withIap };
55
58
  declare const _default: ConfigPlugin<void | ExpoIapPluginOptions>;
56
59
  export default _default;
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.withIosAlternativeBilling = void 0;
39
+ exports.withIap = exports.withIosAlternativeBilling = void 0;
40
40
  const config_plugins_1 = require("expo/config-plugins");
41
41
  const fs = __importStar(require("fs"));
42
42
  const path = __importStar(require("path"));
@@ -219,10 +219,18 @@ const withIapIOS = (config, options) => {
219
219
  };
220
220
  const withIap = (config, options) => {
221
221
  try {
222
+ // Add iapkitApiKey to extra if provided
223
+ if (options?.iapkitApiKey) {
224
+ config.extra = {
225
+ ...config.extra,
226
+ iapkitApiKey: options.iapkitApiKey,
227
+ };
228
+ logOnce('🔑 [expo-iap] Added iapkitApiKey to config.extra');
229
+ }
222
230
  // Read Horizon configuration from modules
223
231
  const isHorizonEnabled = options?.modules?.horizon ?? false;
224
- const horizonAppId = options?.android?.horizonAppId ?? options?.horizonAppId;
225
- const iosAlternativeBilling = options?.ios?.alternativeBilling ?? options?.iosAlternativeBilling;
232
+ const horizonAppId = options?.android?.horizonAppId;
233
+ const iosAlternativeBilling = options?.ios?.alternativeBilling;
226
234
  logOnce(`🔍 [expo-iap] Config values: horizonAppId=${horizonAppId}, isHorizonEnabled=${isHorizonEnabled}`);
227
235
  // Respect explicit flag; fall back to presence of localPath only when flag is unset
228
236
  const isLocalDev = options?.enableLocalDev ?? !!options?.localPath;
@@ -270,4 +278,5 @@ const withIap = (config, options) => {
270
278
  return config;
271
279
  }
272
280
  };
281
+ exports.withIap = withIap;
273
282
  exports.default = (0, config_plugins_1.createRunOncePlugin)(withIap, pkg.name, pkg.version);
@@ -289,6 +289,12 @@ const withIapIOS: ConfigPlugin<IOSAlternativeBillingConfig | undefined> = (
289
289
  };
290
290
 
291
291
  export interface ExpoIapPluginOptions {
292
+ /**
293
+ * IAPKit API key for server-side receipt verification.
294
+ * Get your API key from https://iapkit.com
295
+ * This will be available via `Constants.expoConfig?.extra?.iapkitApiKey`
296
+ */
297
+ iapkitApiKey?: string;
292
298
  /** Local development path for OpenIAP library */
293
299
  localPath?:
294
300
  | string
@@ -336,10 +342,6 @@ export interface ExpoIapPluginOptions {
336
342
  */
337
343
  horizonAppId?: string;
338
344
  };
339
- /** @deprecated Use ios.alternativeBilling instead */
340
- iosAlternativeBilling?: IOSAlternativeBillingConfig;
341
- /** @deprecated Use android.horizonAppId instead */
342
- horizonAppId?: string;
343
345
  }
344
346
 
345
347
  const withIap: ConfigPlugin<ExpoIapPluginOptions | void> = (
@@ -347,13 +349,20 @@ const withIap: ConfigPlugin<ExpoIapPluginOptions | void> = (
347
349
  options,
348
350
  ) => {
349
351
  try {
352
+ // Add iapkitApiKey to extra if provided
353
+ if (options?.iapkitApiKey) {
354
+ config.extra = {
355
+ ...config.extra,
356
+ iapkitApiKey: options.iapkitApiKey,
357
+ };
358
+ logOnce('🔑 [expo-iap] Added iapkitApiKey to config.extra');
359
+ }
360
+
350
361
  // Read Horizon configuration from modules
351
362
  const isHorizonEnabled = options?.modules?.horizon ?? false;
352
363
 
353
- const horizonAppId =
354
- options?.android?.horizonAppId ?? options?.horizonAppId;
355
- const iosAlternativeBilling =
356
- options?.ios?.alternativeBilling ?? options?.iosAlternativeBilling;
364
+ const horizonAppId = options?.android?.horizonAppId;
365
+ const iosAlternativeBilling = options?.ios?.alternativeBilling;
357
366
 
358
367
  logOnce(
359
368
  `🔍 [expo-iap] Config values: horizonAppId=${horizonAppId}, isHorizonEnabled=${isHorizonEnabled}`,
@@ -416,5 +425,5 @@ const withIap: ConfigPlugin<ExpoIapPluginOptions | void> = (
416
425
  }
417
426
  };
418
427
 
419
- export {withIosAlternativeBilling};
428
+ export {withIosAlternativeBilling, withIap};
420
429
  export default createRunOncePlugin(withIap, pkg.name, pkg.version);