@revenuecat/purchases-js 1.16.0 → 1.17.0

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.
@@ -260,6 +260,22 @@ export declare interface HttpConfig {
260
260
  proxyURL?: string;
261
261
  }
262
262
 
263
+ /**
264
+ * Represents the result of an identify user operation.
265
+ * @public
266
+ */
267
+ export declare interface IdentifyResult {
268
+ /**
269
+ * The customer information after the logIn attempt.
270
+ */
271
+ readonly customerInfo: CustomerInfo;
272
+ /**
273
+ * true if a new user has been registered in the backend,
274
+ * false if the user had already been registered.
275
+ */
276
+ readonly wasCreated: boolean;
277
+ }
278
+
263
279
  /**
264
280
  * Custom log handler function type. Allows you to handle SDK log messages
265
281
  * with your own logging system.
@@ -984,544 +1000,557 @@ export declare class Purchases {
984
1000
  */
985
1001
  changeUser(newAppUserId: string): Promise<CustomerInfo>;
986
1002
  /**
987
- * @returns Whether the SDK is using a sandbox API Key.
988
- */
989
- isSandbox(): boolean;
990
- /**
991
- * @returns Whether the current user is anonymous.
992
- */
993
- isAnonymous(): boolean;
1003
+ * Identifies the current user ID with the provided appUserId, as long as the
1004
+ * previous user ID is an anonymous user ID. This will create an alias
1005
+ * between the two user ids in RevenueCat and replace the current user ID used.
1006
+ * If the old user ID is not anonymous, this method will change the current
1007
+ * user ID to the given appUserId without creating an alias.
1008
+ * @returns The customer info for the new user ID.
1009
+ * @throws {@link PurchasesError} if there is an error while performing the aliasing or fetching the customer info.
1010
+ * @param appUserId - The new user ID to identify the current user as.
1011
+ * @experimental
1012
+ */
1013
+ identifyUser(appUserId: string): Promise<IdentifyResult>;
1014
+ private replaceUserId;
1015
+ /**
1016
+ * @returns Whether the SDK is using a sandbox API Key.
1017
+ */
1018
+ isSandbox(): boolean;
1019
+ /**
1020
+ * @returns Whether the current user is anonymous.
1021
+ */
1022
+ isAnonymous(): boolean;
1023
+ /**
1024
+ * Fetches the virtual currencies for the current subscriber.
1025
+ *
1026
+ * @returns {Promise<VirtualCurrencies>} A VirtualCurrencies object containing the subscriber's virtual currencies.
1027
+ */
1028
+ getVirtualCurrencies(): Promise<VirtualCurrencies>;
1029
+ /**
1030
+ * The currently cached {@link VirtualCurrencies} if one is available.
1031
+ * This value will remain null until virtual currencies have been fetched at
1032
+ * least once with {@link Purchases.getVirtualCurrencies} or an equivalent function.
1033
+ *
1034
+ * @returns {VirtualCurrencies | null} A {@link VirtualCurrencies} object containing the subscriber's virtual currencies,
1035
+ * or null if no cached data is available.
1036
+ */
1037
+ getCachedVirtualCurrencies(): VirtualCurrencies | null;
1038
+ /**
1039
+ * Invalidates the cache for virtual currencies.
1040
+ *
1041
+ * This is useful for cases where a virtual currency's balance might have been updated
1042
+ * in a different part of your system, like if you decreased a user's balance from the user spending a virtual currency,
1043
+ * or if you increased the balance from your backend using the server APIs.
1044
+ */
1045
+ invalidateVirtualCurrenciesCache(): void;
1046
+ /**
1047
+ * Closes the Purchases instance. You should never have to do this normally.
1048
+ */
1049
+ close(): void;
1050
+ /**
1051
+ * Generates an anonymous app user ID that follows RevenueCat's format.
1052
+ * This can be used when you don't have a user identifier system in place.
1053
+ * The generated ID will be in the format: $RCAnonymousID:\<UUID without dashes\>
1054
+ * Example: $RCAnonymousID:123e4567e89b12d3a456426614174000
1055
+ * @returns A new anonymous app user ID string
1056
+ * @public
1057
+ */
1058
+ static generateRevenueCatAnonymousAppUserId(): string;
1059
+ }
1060
+
994
1061
  /**
995
- * Fetches the virtual currencies for the current subscriber.
1062
+ * Configuration object for initializing the Purchases SDK.
996
1063
  *
997
- * @returns {Promise<VirtualCurrencies>} A VirtualCurrencies object containing the subscriber's virtual currencies.
998
- */
999
- getVirtualCurrencies(): Promise<VirtualCurrencies>;
1000
- /**
1001
- * The currently cached {@link VirtualCurrencies} if one is available.
1002
- * This value will remain null until virtual currencies have been fetched at
1003
- * least once with {@link Purchases.getVirtualCurrencies} or an equivalent function.
1064
+ * @example
1065
+ * ```typescript
1066
+ * // Object-based configuration (recommended)
1067
+ * const purchases = Purchases.configure({
1068
+ * apiKey: "your_api_key",
1069
+ * appUserId: "user_123",
1070
+ * httpConfig: { additionalHeaders: { "Custom-Header": "value" } },
1071
+ * flags: { autoCollectUTMAsMetadata: true }
1072
+ * });
1004
1073
  *
1005
- * @returns {VirtualCurrencies | null} A {@link VirtualCurrencies} object containing the subscriber's virtual currencies,
1006
- * or null if no cached data is available.
1007
- */
1008
- getCachedVirtualCurrencies(): VirtualCurrencies | null;
1009
- /**
1010
- * Invalidates the cache for virtual currencies.
1074
+ * // Legacy separate arguments (deprecated)
1075
+ * const purchases = Purchases.configure(
1076
+ * "your_api_key",
1077
+ * "user_123",
1078
+ * { additionalHeaders: { "Custom-Header": "value" } },
1079
+ * { autoCollectUTMAsMetadata: true }
1080
+ * );
1081
+ * ```
1011
1082
  *
1012
- * This is useful for cases where a virtual currency's balance might have been updated
1013
- * in a different part of your system, like if you decreased a user's balance from the user spending a virtual currency,
1014
- * or if you increased the balance from your backend using the server APIs.
1083
+ * @public
1015
1084
  */
1016
- invalidateVirtualCurrenciesCache(): void;
1085
+ export declare interface PurchasesConfig {
1086
+ /**
1087
+ * RevenueCat API Key. Can be obtained from the RevenueCat dashboard.
1088
+ */
1089
+ apiKey: string;
1090
+ /**
1091
+ * Your unique id for identifying the user.
1092
+ */
1093
+ appUserId: string;
1094
+ /**
1095
+ * Advanced http configuration to customise the SDK usage {@link HttpConfig}.
1096
+ */
1097
+ httpConfig?: HttpConfig;
1098
+ /**
1099
+ * Advanced functionality configuration {@link FlagsConfig}.
1100
+ */
1101
+ flags?: FlagsConfig;
1102
+ }
1103
+
1017
1104
  /**
1018
- * Closes the Purchases instance. You should never have to do this normally.
1105
+ * Error class for Purchases SDK. You should handle these errors and react
1106
+ * accordingly in your app.
1107
+ * @public
1019
1108
  */
1020
- close(): void;
1109
+ export declare class PurchasesError extends Error {
1110
+ /**
1111
+ * Error code for the error. This is useful to appropriately react to
1112
+ * different error situations.
1113
+ */
1114
+ readonly errorCode: ErrorCode;
1115
+ /**
1116
+ * Underlying error message. This provides more details on the error and
1117
+ * can be useful for debugging and logging.
1118
+ */
1119
+ readonly underlyingErrorMessage?: string | null | undefined;
1120
+ /**
1121
+ * Contains extra information that is available in certain types of errors.
1122
+ */
1123
+ readonly extra?: PurchasesErrorExtra | undefined;
1124
+ constructor(
1125
+ /**
1126
+ * Error code for the error. This is useful to appropriately react to
1127
+ * different error situations.
1128
+ */
1129
+ errorCode: ErrorCode,
1130
+ /**
1131
+ * Message for the error. This is useful for debugging and logging.
1132
+ */
1133
+ message?: string,
1134
+ /**
1135
+ * Underlying error message. This provides more details on the error and
1136
+ * can be useful for debugging and logging.
1137
+ */
1138
+ underlyingErrorMessage?: string | null | undefined,
1139
+ /**
1140
+ * Contains extra information that is available in certain types of errors.
1141
+ */
1142
+ extra?: PurchasesErrorExtra | undefined);
1143
+ toString: () => string;
1144
+ }
1145
+
1021
1146
  /**
1022
- * Generates an anonymous app user ID that follows RevenueCat's format.
1023
- * This can be used when you don't have a user identifier system in place.
1024
- * The generated ID will be in the format: $RCAnonymousID:\<UUID without dashes\>
1025
- * Example: $RCAnonymousID:123e4567e89b12d3a456426614174000
1026
- * @returns A new anonymous app user ID string
1147
+ * Extra information that is available in certain types of errors.
1027
1148
  * @public
1028
1149
  */
1029
- static generateRevenueCatAnonymousAppUserId(): string;
1030
- }
1031
-
1032
- /**
1033
- * Configuration object for initializing the Purchases SDK.
1034
- *
1035
- * @example
1036
- * ```typescript
1037
- * // Object-based configuration (recommended)
1038
- * const purchases = Purchases.configure({
1039
- * apiKey: "your_api_key",
1040
- * appUserId: "user_123",
1041
- * httpConfig: { additionalHeaders: { "Custom-Header": "value" } },
1042
- * flags: { autoCollectUTMAsMetadata: true }
1043
- * });
1044
- *
1045
- * // Legacy separate arguments (deprecated)
1046
- * const purchases = Purchases.configure(
1047
- * "your_api_key",
1048
- * "user_123",
1049
- * { additionalHeaders: { "Custom-Header": "value" } },
1050
- * { autoCollectUTMAsMetadata: true }
1051
- * );
1052
- * ```
1053
- *
1054
- * @public
1055
- */
1056
- export declare interface PurchasesConfig {
1057
- /**
1058
- * RevenueCat API Key. Can be obtained from the RevenueCat dashboard.
1059
- */
1060
- apiKey: string;
1061
- /**
1062
- * Your unique id for identifying the user.
1063
- */
1064
- appUserId: string;
1065
- /**
1066
- * Advanced http configuration to customise the SDK usage {@link HttpConfig}.
1067
- */
1068
- httpConfig?: HttpConfig;
1069
- /**
1070
- * Advanced functionality configuration {@link FlagsConfig}.
1071
- */
1072
- flags?: FlagsConfig;
1073
- }
1074
-
1075
- /**
1076
- * Error class for Purchases SDK. You should handle these errors and react
1077
- * accordingly in your app.
1078
- * @public
1079
- */
1080
- export declare class PurchasesError extends Error {
1081
- /**
1082
- * Error code for the error. This is useful to appropriately react to
1083
- * different error situations.
1084
- */
1085
- readonly errorCode: ErrorCode;
1086
- /**
1087
- * Underlying error message. This provides more details on the error and
1088
- * can be useful for debugging and logging.
1089
- */
1090
- readonly underlyingErrorMessage?: string | null | undefined;
1091
- /**
1092
- * Contains extra information that is available in certain types of errors.
1093
- */
1094
- readonly extra?: PurchasesErrorExtra | undefined;
1095
- constructor(
1096
- /**
1097
- * Error code for the error. This is useful to appropriately react to
1098
- * different error situations.
1099
- */
1100
- errorCode: ErrorCode,
1101
- /**
1102
- * Message for the error. This is useful for debugging and logging.
1103
- */
1104
- message?: string,
1105
- /**
1106
- * Underlying error message. This provides more details on the error and
1107
- * can be useful for debugging and logging.
1108
- */
1109
- underlyingErrorMessage?: string | null | undefined,
1110
- /**
1111
- * Contains extra information that is available in certain types of errors.
1112
- */
1113
- extra?: PurchasesErrorExtra | undefined);
1114
- toString: () => string;
1115
- }
1116
-
1117
- /**
1118
- * Extra information that is available in certain types of errors.
1119
- * @public
1120
- */
1121
- export declare interface PurchasesErrorExtra {
1122
- /**
1123
- * If this is a request error, the HTTP status code of the response.
1124
- */
1125
- readonly statusCode?: number;
1126
- /**
1127
- * If this is a RevenueCat backend error, the error code from the servers.
1128
- */
1129
- readonly backendErrorCode?: number;
1130
- }
1150
+ export declare interface PurchasesErrorExtra {
1151
+ /**
1152
+ * If this is a request error, the HTTP status code of the response.
1153
+ */
1154
+ readonly statusCode?: number;
1155
+ /**
1156
+ * If this is a RevenueCat backend error, the error code from the servers.
1157
+ */
1158
+ readonly backendErrorCode?: number;
1159
+ }
1131
1160
 
1132
- /**
1133
- * This object gives you access to the purchase redemption data when
1134
- * the purchase can be redeemed to a mobile user, like in the case of anonymous users.
1135
- * @public
1136
- */
1137
- export declare interface RedemptionInfo {
1138
- /**
1139
- * The redeem url.
1140
- */
1141
- readonly redeemUrl: string | null;
1142
- }
1161
+ /**
1162
+ * This object gives you access to the purchase redemption data when
1163
+ * the purchase can be redeemed to a mobile user, like in the case of anonymous users.
1164
+ * @public
1165
+ */
1166
+ export declare interface RedemptionInfo {
1167
+ /**
1168
+ * The redeem url.
1169
+ */
1170
+ readonly redeemUrl: string | null;
1171
+ }
1143
1172
 
1144
- /**
1145
- * Enumeration of reserved customer attributes.
1146
- * @public
1147
- */
1148
- export declare enum ReservedCustomerAttribute {
1149
- /**
1150
- * The display name that should be used to reference the customer.
1151
- */
1152
- DisplayName = "$displayName",
1153
- /**
1154
- * The email address of the customer.
1155
- */
1156
- Email = "$email",
1157
- /**
1158
- * The phone number of the customer.
1159
- */
1160
- PhoneNumber = "$phoneNumber",
1161
- /**
1162
- * iOS advertising identifier UUID for the customer.
1163
- */
1164
- IDFA = "$idfa",
1165
- /**
1166
- * iOS vendor identifier UUID for the customer.
1167
- */
1168
- IDFV = "$idfv",
1169
- /**
1170
- * The advertising ID that is provided by Google Play services for the customer.
1171
- */
1172
- GPSAdId = "$gpsAdId",
1173
- /**
1174
- * The Android ID of the customer.
1175
- */
1176
- AndroidId = "$androidId",
1177
- /**
1178
- * The Amazon Advertising ID of the customer.
1179
- */
1180
- AmazonAdId = "$amazonAdId",
1181
- /**
1182
- * The IP address of the customer.
1183
- */
1184
- IP = "$ip",
1185
- /**
1186
- * The unique Adjust identifier for the customer.
1187
- */
1188
- AdjustId = "$adjustId",
1189
- /**
1190
- * The Amplitude device ID of the customer.
1191
- */
1192
- AmplitudeDeviceId = "$amplitudeDeviceId",
1193
- /**
1194
- * The Amplitude user ID of the customer.
1195
- */
1196
- AmplitudeUserId = "$amplitudeUserId",
1197
- /**
1198
- * Appsflyer Id. The unique Appsflyer identifier for the customer.
1199
- */
1200
- AppsflyerId = "$appsflyerId",
1201
- /**
1202
- * The AppsFlyer sharing filter of the customer.
1203
- */
1204
- AppsflyerSharingFilter = "$appsflyerSharingFilter",
1205
- /**
1206
- * The Branch ID of the customer.
1207
- */
1208
- BranchId = "$branchId",
1209
- /**
1210
- * The Braze 'alias_name' in User Alias Object.
1211
- */
1212
- BrazeAliasName = "$brazeAliasName",
1213
- /**
1214
- * The Braze 'alias_label' in User Alias Object.
1215
- */
1216
- BrazeAliasLabel = "$brazeAliasLabel",
1217
- /**
1218
- * The CleverTap ID of the customer.
1219
- */
1220
- ClevertapId = "$clevertapId",
1221
- /**
1222
- * The Facebook anonymous ID of the customer.
1223
- */
1224
- FbAnonId = "$fbAnonId",
1225
- /**
1226
- * The unique mParticle user identifier (mpid).
1227
- */
1228
- MparticleId = "$mparticleId",
1229
- /**
1230
- * The OneSignal Player Id for the customer.
1231
- */
1232
- OnesignalId = "$onesignalId",
1233
- /**
1234
- * The OneSignal user ID of the customer.
1235
- */
1236
- OnesignalUserId = "$onesignalUserId",
1237
- /**
1238
- * The Intercom contact ID of the customer.
1239
- */
1240
- IntercomContactId = "$intercomContactId",
1241
- /**
1242
- * The media source of the customer.
1243
- */
1244
- MediaSource = "$mediaSource",
1245
- /**
1246
- * The campaign of the customer.
1247
- */
1248
- Campaign = "$campaign",
1249
- /**
1250
- * The ad group of the customer.
1251
- */
1252
- AdGroup = "$adGroup",
1253
- /**
1254
- * The Ad ID of the customer.
1255
- */
1256
- AdId = "$ad",
1257
- /**
1258
- * The keyword of the customer.
1259
- */
1260
- Keyword = "$keyword",
1261
- /**
1262
- * The creative of the customer.
1263
- */
1264
- Creative = "$creative",
1265
- /**
1266
- * Apple push notification tokens for the customer.
1267
- */
1268
- APNSTokens = "$apnsTokens",
1269
- /**
1270
- * Google push notification tokens for the customer.
1271
- */
1272
- FCMTokens = "$fcmTokens",
1273
- /**
1274
- * The Airship channel ID of the customer.
1275
- */
1276
- AirshipChannelId = "$airshipChannelId",
1277
- /**
1278
- * The segment ID of the customer.
1279
- */
1280
- SegmentId = "$segmentId",
1281
- /**
1282
- * The Iterable user ID of the customer.
1283
- */
1284
- IterableUserId = "$iterableUserId",
1285
- /**
1286
- * The Iterable campaign ID of the customer.
1287
- */
1288
- IterableCampaignId = "$iterableCampaignId",
1289
- /**
1290
- * The Iterable template ID of the customer.
1291
- */
1292
- IterableTemplateId = "$iterableTemplateId",
1293
- /**
1294
- * The Firebase app instance ID of the customer.
1295
- */
1296
- FirebaseAppInstanceId = "$firebaseAppInstanceId",
1297
- /**
1298
- * The Mixpanel distinct ID of the customer.
1299
- */
1300
- MixpanelDistinctId = "$mixpanelDistinctId",
1301
- /**
1302
- * Apple App Tracking Transparency consent status for the customer.
1303
- */
1304
- ATTConsentStatus = "$attConsentStatus",
1305
- /**
1306
- * The unique Kochava device identifier of the customer.
1307
- */
1308
- KochavaDeviceId = "$kochavaDeviceId",
1309
- /**
1310
- * The device version of the customer.
1311
- */
1312
- DeviceVersion = "$deviceVersion",
1313
- /**
1314
- * The PostHog user ID of the customer.
1315
- */
1316
- PosthogUserId = "$posthogUserId",
1317
- /**
1318
- * The Telemetry Deck user ID of the customer.
1319
- */
1320
- TelemetryDeckUserId = "$telemetryDeckUserId",
1321
- /**
1322
- * The Telemetry Deck app ID of the customer.
1323
- */
1324
- TelemetryDeckAppId = "$telemetryDeckAppId",
1325
- /**
1326
- * The Apple refund handling preference of the customer.
1327
- */
1328
- AppleRefundHandlingPreference = "$appleRefundHandlingPreference",
1329
- /**
1330
- * The customer.io ID of the customer.
1331
- */
1332
- CustomerioId = "$customerioId",
1333
- /**
1334
- * The Tenjin ID of the customer.
1335
- */
1336
- TenjinId = "$tenjinId"
1337
- }
1173
+ /**
1174
+ * Enumeration of reserved customer attributes.
1175
+ * @public
1176
+ */
1177
+ export declare enum ReservedCustomerAttribute {
1178
+ /**
1179
+ * The display name that should be used to reference the customer.
1180
+ */
1181
+ DisplayName = "$displayName",
1182
+ /**
1183
+ * The email address of the customer.
1184
+ */
1185
+ Email = "$email",
1186
+ /**
1187
+ * The phone number of the customer.
1188
+ */
1189
+ PhoneNumber = "$phoneNumber",
1190
+ /**
1191
+ * iOS advertising identifier UUID for the customer.
1192
+ */
1193
+ IDFA = "$idfa",
1194
+ /**
1195
+ * iOS vendor identifier UUID for the customer.
1196
+ */
1197
+ IDFV = "$idfv",
1198
+ /**
1199
+ * The advertising ID that is provided by Google Play services for the customer.
1200
+ */
1201
+ GPSAdId = "$gpsAdId",
1202
+ /**
1203
+ * The Android ID of the customer.
1204
+ */
1205
+ AndroidId = "$androidId",
1206
+ /**
1207
+ * The Amazon Advertising ID of the customer.
1208
+ */
1209
+ AmazonAdId = "$amazonAdId",
1210
+ /**
1211
+ * The IP address of the customer.
1212
+ */
1213
+ IP = "$ip",
1214
+ /**
1215
+ * The unique Adjust identifier for the customer.
1216
+ */
1217
+ AdjustId = "$adjustId",
1218
+ /**
1219
+ * The Amplitude device ID of the customer.
1220
+ */
1221
+ AmplitudeDeviceId = "$amplitudeDeviceId",
1222
+ /**
1223
+ * The Amplitude user ID of the customer.
1224
+ */
1225
+ AmplitudeUserId = "$amplitudeUserId",
1226
+ /**
1227
+ * Appsflyer Id. The unique Appsflyer identifier for the customer.
1228
+ */
1229
+ AppsflyerId = "$appsflyerId",
1230
+ /**
1231
+ * The AppsFlyer sharing filter of the customer.
1232
+ */
1233
+ AppsflyerSharingFilter = "$appsflyerSharingFilter",
1234
+ /**
1235
+ * The Branch ID of the customer.
1236
+ */
1237
+ BranchId = "$branchId",
1238
+ /**
1239
+ * The Braze 'alias_name' in User Alias Object.
1240
+ */
1241
+ BrazeAliasName = "$brazeAliasName",
1242
+ /**
1243
+ * The Braze 'alias_label' in User Alias Object.
1244
+ */
1245
+ BrazeAliasLabel = "$brazeAliasLabel",
1246
+ /**
1247
+ * The CleverTap ID of the customer.
1248
+ */
1249
+ ClevertapId = "$clevertapId",
1250
+ /**
1251
+ * The Facebook anonymous ID of the customer.
1252
+ */
1253
+ FbAnonId = "$fbAnonId",
1254
+ /**
1255
+ * The unique mParticle user identifier (mpid).
1256
+ */
1257
+ MparticleId = "$mparticleId",
1258
+ /**
1259
+ * The OneSignal Player Id for the customer.
1260
+ */
1261
+ OnesignalId = "$onesignalId",
1262
+ /**
1263
+ * The OneSignal user ID of the customer.
1264
+ */
1265
+ OnesignalUserId = "$onesignalUserId",
1266
+ /**
1267
+ * The Intercom contact ID of the customer.
1268
+ */
1269
+ IntercomContactId = "$intercomContactId",
1270
+ /**
1271
+ * The media source of the customer.
1272
+ */
1273
+ MediaSource = "$mediaSource",
1274
+ /**
1275
+ * The campaign of the customer.
1276
+ */
1277
+ Campaign = "$campaign",
1278
+ /**
1279
+ * The ad group of the customer.
1280
+ */
1281
+ AdGroup = "$adGroup",
1282
+ /**
1283
+ * The Ad ID of the customer.
1284
+ */
1285
+ AdId = "$ad",
1286
+ /**
1287
+ * The keyword of the customer.
1288
+ */
1289
+ Keyword = "$keyword",
1290
+ /**
1291
+ * The creative of the customer.
1292
+ */
1293
+ Creative = "$creative",
1294
+ /**
1295
+ * Apple push notification tokens for the customer.
1296
+ */
1297
+ APNSTokens = "$apnsTokens",
1298
+ /**
1299
+ * Google push notification tokens for the customer.
1300
+ */
1301
+ FCMTokens = "$fcmTokens",
1302
+ /**
1303
+ * The Airship channel ID of the customer.
1304
+ */
1305
+ AirshipChannelId = "$airshipChannelId",
1306
+ /**
1307
+ * The segment ID of the customer.
1308
+ */
1309
+ SegmentId = "$segmentId",
1310
+ /**
1311
+ * The Iterable user ID of the customer.
1312
+ */
1313
+ IterableUserId = "$iterableUserId",
1314
+ /**
1315
+ * The Iterable campaign ID of the customer.
1316
+ */
1317
+ IterableCampaignId = "$iterableCampaignId",
1318
+ /**
1319
+ * The Iterable template ID of the customer.
1320
+ */
1321
+ IterableTemplateId = "$iterableTemplateId",
1322
+ /**
1323
+ * The Firebase app instance ID of the customer.
1324
+ */
1325
+ FirebaseAppInstanceId = "$firebaseAppInstanceId",
1326
+ /**
1327
+ * The Mixpanel distinct ID of the customer.
1328
+ */
1329
+ MixpanelDistinctId = "$mixpanelDistinctId",
1330
+ /**
1331
+ * Apple App Tracking Transparency consent status for the customer.
1332
+ */
1333
+ ATTConsentStatus = "$attConsentStatus",
1334
+ /**
1335
+ * The unique Kochava device identifier of the customer.
1336
+ */
1337
+ KochavaDeviceId = "$kochavaDeviceId",
1338
+ /**
1339
+ * The device version of the customer.
1340
+ */
1341
+ DeviceVersion = "$deviceVersion",
1342
+ /**
1343
+ * The PostHog user ID of the customer.
1344
+ */
1345
+ PosthogUserId = "$posthogUserId",
1346
+ /**
1347
+ * The Telemetry Deck user ID of the customer.
1348
+ */
1349
+ TelemetryDeckUserId = "$telemetryDeckUserId",
1350
+ /**
1351
+ * The Telemetry Deck app ID of the customer.
1352
+ */
1353
+ TelemetryDeckAppId = "$telemetryDeckAppId",
1354
+ /**
1355
+ * The Apple refund handling preference of the customer.
1356
+ */
1357
+ AppleRefundHandlingPreference = "$appleRefundHandlingPreference",
1358
+ /**
1359
+ * The customer.io ID of the customer.
1360
+ */
1361
+ CustomerioId = "$customerioId",
1362
+ /**
1363
+ * The Tenjin ID of the customer.
1364
+ */
1365
+ TenjinId = "$tenjinId"
1366
+ }
1338
1367
 
1339
- /**
1340
- * The store where the user originally subscribed.
1341
- * @public
1342
- */
1343
- export declare type Store = "app_store" | "mac_app_store" | "play_store" | "amazon" | "stripe" | "rc_billing" | "promotional" | "paddle" | "test_store" | "unknown";
1368
+ /**
1369
+ * The store where the user originally subscribed.
1370
+ * @public
1371
+ */
1372
+ export declare type Store = "app_store" | "mac_app_store" | "play_store" | "amazon" | "stripe" | "rc_billing" | "promotional" | "paddle" | "test_store" | "unknown";
1344
1373
 
1345
- /**
1346
- * Represents a transaction made in the store.
1347
- * @public
1348
- */
1349
- export declare interface StoreTransaction {
1350
- /**
1351
- * The unique identifier for the store transaction.
1352
- */
1353
- readonly storeTransactionId: string;
1354
- /**
1355
- * The identifier of the product purchased in the transaction.
1356
- */
1357
- readonly productIdentifier: string;
1358
- /**
1359
- * The date when the transaction was made.
1360
- */
1361
- readonly purchaseDate: Date;
1362
- }
1374
+ /**
1375
+ * Represents a transaction made in the store.
1376
+ * @public
1377
+ */
1378
+ export declare interface StoreTransaction {
1379
+ /**
1380
+ * The unique identifier for the store transaction.
1381
+ */
1382
+ readonly storeTransactionId: string;
1383
+ /**
1384
+ * The identifier of the product purchased in the transaction.
1385
+ */
1386
+ readonly productIdentifier: string;
1387
+ /**
1388
+ * The date when the transaction was made.
1389
+ */
1390
+ readonly purchaseDate: Date;
1391
+ }
1363
1392
 
1364
- /**
1365
- * Subscription purchases of the Customer.
1366
- * @public
1367
- */
1368
- export declare interface SubscriptionInfo {
1369
- /**
1370
- * The product identifier.
1371
- */
1372
- readonly productIdentifier: string;
1373
- /**
1374
- * Date when the last subscription period started.
1375
- */
1376
- readonly purchaseDate: Date;
1377
- /**
1378
- * Date when this subscription first started. This property does not update with renewals.
1379
- * This property also does not update for product changes within a subscription group or
1380
- * re-subscriptions by lapsed subscribers.
1381
- */
1382
- readonly originalPurchaseDate: Date | null;
1383
- /**
1384
- * Date when the subscription expires/expired
1385
- */
1386
- readonly expiresDate: Date | null;
1387
- /**
1388
- * Store where the subscription was purchased.
1389
- */
1390
- readonly store: Store;
1391
- /**
1392
- * Date when RevenueCat detected that auto-renewal was turned off for this subscription.
1393
- * Note the subscription may still be active, check the {@link SubscriptionInfo.expiresDate} attribute.
1394
- */
1395
- readonly unsubscribeDetectedAt: Date | null;
1396
- /**
1397
- * Whether or not the purchase was made in sandbox mode.
1398
- */
1399
- readonly isSandbox: boolean;
1400
- /**
1401
- * Date when RevenueCat detected any billing issues with this subscription.
1402
- * If and when the billing issue gets resolved, this field is set to null.
1403
- * Note the subscription may still be active, check the {@link SubscriptionInfo.expiresDate} attribute.
1404
- */
1405
- readonly billingIssuesDetectedAt: Date | null;
1406
- /**
1407
- * Date when any grace period for this subscription expires/expired.
1408
- * null if the customer has never been in a grace period.
1409
- */
1410
- readonly gracePeriodExpiresDate: Date | null;
1411
- /**
1412
- * How the Customer received access to this subscription:
1413
- * - "PURCHASED": The customer bought the subscription.
1414
- * - "FAMILY_SHARED": The customer has access to the product via their family.
1415
- */
1416
- readonly ownershipType: OwnershipType;
1417
- /**
1418
- * Type of the current subscription period:
1419
- * - "normal": The product is in a normal period (default)
1420
- * - "trial": The product is in a free trial period
1421
- * - "intro": The product is in an introductory pricing period
1422
- * - "prepaid": The product is in a prepaid pricing period
1423
- */
1424
- readonly periodType: PeriodType;
1425
- /**
1426
- * Date when RevenueCat detected a refund of this subscription.
1427
- */
1428
- readonly refundedAt: Date | null;
1429
- /**
1430
- * The transaction id in the store of the subscription.
1431
- */
1432
- readonly storeTransactionId: string | null;
1433
- /**
1434
- * Whether the subscription is currently active
1435
- * (at the time this object was obtained).
1436
- */
1437
- readonly isActive: boolean;
1438
- /**
1439
- * Whether the subscription will renew at the next billing period.
1440
- */
1441
- readonly willRenew: boolean;
1442
- }
1393
+ /**
1394
+ * Subscription purchases of the Customer.
1395
+ * @public
1396
+ */
1397
+ export declare interface SubscriptionInfo {
1398
+ /**
1399
+ * The product identifier.
1400
+ */
1401
+ readonly productIdentifier: string;
1402
+ /**
1403
+ * Date when the last subscription period started.
1404
+ */
1405
+ readonly purchaseDate: Date;
1406
+ /**
1407
+ * Date when this subscription first started. This property does not update with renewals.
1408
+ * This property also does not update for product changes within a subscription group or
1409
+ * re-subscriptions by lapsed subscribers.
1410
+ */
1411
+ readonly originalPurchaseDate: Date | null;
1412
+ /**
1413
+ * Date when the subscription expires/expired
1414
+ */
1415
+ readonly expiresDate: Date | null;
1416
+ /**
1417
+ * Store where the subscription was purchased.
1418
+ */
1419
+ readonly store: Store;
1420
+ /**
1421
+ * Date when RevenueCat detected that auto-renewal was turned off for this subscription.
1422
+ * Note the subscription may still be active, check the {@link SubscriptionInfo.expiresDate} attribute.
1423
+ */
1424
+ readonly unsubscribeDetectedAt: Date | null;
1425
+ /**
1426
+ * Whether or not the purchase was made in sandbox mode.
1427
+ */
1428
+ readonly isSandbox: boolean;
1429
+ /**
1430
+ * Date when RevenueCat detected any billing issues with this subscription.
1431
+ * If and when the billing issue gets resolved, this field is set to null.
1432
+ * Note the subscription may still be active, check the {@link SubscriptionInfo.expiresDate} attribute.
1433
+ */
1434
+ readonly billingIssuesDetectedAt: Date | null;
1435
+ /**
1436
+ * Date when any grace period for this subscription expires/expired.
1437
+ * null if the customer has never been in a grace period.
1438
+ */
1439
+ readonly gracePeriodExpiresDate: Date | null;
1440
+ /**
1441
+ * How the Customer received access to this subscription:
1442
+ * - "PURCHASED": The customer bought the subscription.
1443
+ * - "FAMILY_SHARED": The customer has access to the product via their family.
1444
+ */
1445
+ readonly ownershipType: OwnershipType;
1446
+ /**
1447
+ * Type of the current subscription period:
1448
+ * - "normal": The product is in a normal period (default)
1449
+ * - "trial": The product is in a free trial period
1450
+ * - "intro": The product is in an introductory pricing period
1451
+ * - "prepaid": The product is in a prepaid pricing period
1452
+ */
1453
+ readonly periodType: PeriodType;
1454
+ /**
1455
+ * Date when RevenueCat detected a refund of this subscription.
1456
+ */
1457
+ readonly refundedAt: Date | null;
1458
+ /**
1459
+ * The transaction id in the store of the subscription.
1460
+ */
1461
+ readonly storeTransactionId: string | null;
1462
+ /**
1463
+ * Whether the subscription is currently active
1464
+ * (at the time this object was obtained).
1465
+ */
1466
+ readonly isActive: boolean;
1467
+ /**
1468
+ * Whether the subscription will renew at the next billing period.
1469
+ */
1470
+ readonly willRenew: boolean;
1471
+ }
1443
1472
 
1444
- /**
1445
- * Represents a possible option to purchase a subscription product.
1446
- * @public
1447
- */
1448
- export declare interface SubscriptionOption extends PurchaseOption {
1449
- /**
1450
- * The base phase for a SubscriptionOption, represents
1451
- * the price that the customer will be charged after all the discounts have
1452
- * been consumed and the period at which it will renew.
1453
- */
1454
- readonly base: PricingPhase;
1455
- /**
1456
- * The trial information for this subscription option if available.
1457
- */
1458
- readonly trial: PricingPhase | null;
1459
- /**
1460
- * The introductory price period for this subscription option if available.
1461
- */
1462
- readonly introPrice: PricingPhase | null;
1463
- }
1473
+ /**
1474
+ * Represents a possible option to purchase a subscription product.
1475
+ * @public
1476
+ */
1477
+ export declare interface SubscriptionOption extends PurchaseOption {
1478
+ /**
1479
+ * The base phase for a SubscriptionOption, represents
1480
+ * the price that the customer will be charged after all the discounts have
1481
+ * been consumed and the period at which it will renew.
1482
+ */
1483
+ readonly base: PricingPhase;
1484
+ /**
1485
+ * The trial information for this subscription option if available.
1486
+ */
1487
+ readonly trial: PricingPhase | null;
1488
+ /**
1489
+ * The introductory price period for this subscription option if available.
1490
+ */
1491
+ readonly introPrice: PricingPhase | null;
1492
+ }
1464
1493
 
1465
- /**
1466
- * Contains information about the targeting context used to obtain an object.
1467
- * @public
1468
- */
1469
- export declare interface TargetingContext {
1470
- /**
1471
- * The rule id from the targeting used to obtain this object.
1472
- */
1473
- readonly ruleId: string;
1474
- /**
1475
- * The revision of the targeting used to obtain this object.
1476
- */
1477
- readonly revision: number;
1478
- }
1494
+ /**
1495
+ * Contains information about the targeting context used to obtain an object.
1496
+ * @public
1497
+ */
1498
+ export declare interface TargetingContext {
1499
+ /**
1500
+ * The rule id from the targeting used to obtain this object.
1501
+ */
1502
+ readonly ruleId: string;
1503
+ /**
1504
+ * The revision of the targeting used to obtain this object.
1505
+ */
1506
+ readonly revision: number;
1507
+ }
1479
1508
 
1480
- /**
1481
- * Error indicating that the SDK was accessed before it was initialized.
1482
- * @public
1483
- */
1484
- export declare class UninitializedPurchasesError extends Error {
1485
- constructor();
1486
- }
1509
+ /**
1510
+ * Error indicating that the SDK was accessed before it was initialized.
1511
+ * @public
1512
+ */
1513
+ export declare class UninitializedPurchasesError extends Error {
1514
+ constructor();
1515
+ }
1487
1516
 
1488
- /**
1489
- * The VirtualCurrencies object contains all the virtual currencies associated to the user.
1490
- *
1491
- * @public
1492
- */
1493
- export declare interface VirtualCurrencies {
1494
- /**
1495
- * Map of all {@link VirtualCurrency} objects keyed by virtual currency code.
1496
- */
1497
- readonly all: {
1498
- [key: string]: VirtualCurrency;
1499
- };
1500
- }
1517
+ /**
1518
+ * The VirtualCurrencies object contains all the virtual currencies associated to the user.
1519
+ *
1520
+ * @public
1521
+ */
1522
+ export declare interface VirtualCurrencies {
1523
+ /**
1524
+ * Map of all {@link VirtualCurrency} objects keyed by virtual currency code.
1525
+ */
1526
+ readonly all: {
1527
+ [key: string]: VirtualCurrency;
1528
+ };
1529
+ }
1501
1530
 
1502
- /**
1503
- * The VirtualCurrency object represents information about a virtual currency in the app.
1504
- * Use this object to access information about a virtual currency, such as its current balance.
1505
- *
1506
- * @public
1507
- */
1508
- export declare interface VirtualCurrency {
1509
- /**
1510
- * The virtual currency's balance.
1511
- */
1512
- readonly balance: number;
1513
- /**
1514
- * The virtual currency's name.
1515
- */
1516
- readonly name: string;
1517
- /**
1518
- * The virtual currency's code.
1519
- */
1520
- readonly code: string;
1521
- /**
1522
- * The virtual currency's description defined in the RevenueCat dashboard.
1523
- */
1524
- readonly serverDescription: string | null;
1525
- }
1531
+ /**
1532
+ * The VirtualCurrency object represents information about a virtual currency in the app.
1533
+ * Use this object to access information about a virtual currency, such as its current balance.
1534
+ *
1535
+ * @public
1536
+ */
1537
+ export declare interface VirtualCurrency {
1538
+ /**
1539
+ * The virtual currency's balance.
1540
+ */
1541
+ readonly balance: number;
1542
+ /**
1543
+ * The virtual currency's name.
1544
+ */
1545
+ readonly name: string;
1546
+ /**
1547
+ * The virtual currency's code.
1548
+ */
1549
+ readonly code: string;
1550
+ /**
1551
+ * The virtual currency's description defined in the RevenueCat dashboard.
1552
+ */
1553
+ readonly serverDescription: string | null;
1554
+ }
1526
1555
 
1527
- export { }
1556
+ export { }