@revenuecat/purchases-js 1.6.0 → 1.7.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.
- package/dist/Purchases.es.d.ts +520 -468
- package/dist/Purchases.es.js +233 -208
- package/dist/Purchases.umd.js +24 -24
- package/package.json +1 -1
package/dist/Purchases.es.d.ts
CHANGED
|
@@ -828,7 +828,7 @@ export declare class Purchases {
|
|
|
828
828
|
static setPlatformInfo(platformInfo: PlatformInfo): void;
|
|
829
829
|
/**
|
|
830
830
|
* Get the singleton instance of Purchases. It's preferred to use the instance
|
|
831
|
-
* obtained from the
|
|
831
|
+
* obtained from the `configure` method when possible.
|
|
832
832
|
* @throws {@link UninitializedPurchasesError} if the instance has not been initialized yet.
|
|
833
833
|
*/
|
|
834
834
|
static getSharedInstance(): Purchases;
|
|
@@ -840,505 +840,557 @@ export declare class Purchases {
|
|
|
840
840
|
* Configures the Purchases SDK. This should be called as soon as your app
|
|
841
841
|
* has a unique user id for your user. You should only call this once, and
|
|
842
842
|
* keep the returned instance around for use throughout your application.
|
|
843
|
-
* @param
|
|
844
|
-
* @param appUserId - Your unique id for identifying the user.
|
|
845
|
-
* @param httpConfig - Advanced http configuration to customise the SDK usage {@link HttpConfig}.
|
|
846
|
-
* @param flags - Advanced functionality configuration {@link FlagsConfig}.
|
|
843
|
+
* @param config - Configuration object containing apiKey, appUserId, and optional configurations.
|
|
847
844
|
* @throws {@link PurchasesError} if the API key or user id are invalid.
|
|
848
845
|
*/
|
|
849
|
-
static configure(
|
|
846
|
+
static configure(config: PurchasesConfig): Purchases;
|
|
850
847
|
/**
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
* Fetch the configured offerings for this user. You can configure these
|
|
859
|
-
* in the RevenueCat dashboard.
|
|
860
|
-
* @param params - The parameters object to customise the offerings fetch. Check {@link GetOfferingsParams}
|
|
861
|
-
*/
|
|
862
|
-
getOfferings(params?: GetOfferingsParams): Promise<Offerings>;
|
|
863
|
-
/**
|
|
864
|
-
* Retrieves a specific offering by a placement identifier.
|
|
865
|
-
* For more info see https://www.revenuecat.com/docs/tools/targeting
|
|
866
|
-
* @param placementIdentifier - The placement identifier to retrieve the offering for.
|
|
867
|
-
* @param params - The parameters object to customise the offerings fetch. Check {@link GetOfferingsParams}
|
|
868
|
-
*/
|
|
869
|
-
getCurrentOfferingForPlacement(placementIdentifier: string, params?: GetOfferingsParams): Promise<Offering | null>;
|
|
870
|
-
private getAllOfferings;
|
|
871
|
-
/**
|
|
872
|
-
* Convenience method to check whether a user is entitled to a specific
|
|
873
|
-
* entitlement. This will use {@link Purchases.getCustomerInfo} under the hood.
|
|
874
|
-
* @param entitlementIdentifier - The entitlement identifier you want to check.
|
|
875
|
-
* @returns Whether the user is entitled to the specified entitlement
|
|
876
|
-
* @throws {@link PurchasesError} if there is an error while fetching the customer info.
|
|
877
|
-
* @see {@link Purchases.getCustomerInfo}
|
|
848
|
+
* Legacy method to configure the Purchases SDK. This method is deprecated and will be removed in a future version.
|
|
849
|
+
* @deprecated - please use the `configure` method with a {@link PurchasesConfig} object instead.
|
|
850
|
+
* @param apiKey - RevenueCat API Key. Can be obtained from the RevenueCat dashboard.
|
|
851
|
+
* @param appUserId - Your unique id for identifying the user.
|
|
852
|
+
* @param httpConfig - Advanced http configuration to customise the SDK usage {@link HttpConfig}.
|
|
853
|
+
* @param flags - Advanced functionality configuration {@link FlagsConfig}.
|
|
854
|
+
* @throws {@link PurchasesError} if the API key or user id are invalid.
|
|
878
855
|
*/
|
|
879
|
-
|
|
856
|
+
static configure(apiKey: string, appUserId: string, httpConfig?: HttpConfig, flags?: FlagsConfig): Purchases;
|
|
857
|
+
private static configureInternal;
|
|
858
|
+
private static validateConfig;
|
|
859
|
+
/**
|
|
860
|
+
* Loads and caches some optional data in the Purchases SDK.
|
|
861
|
+
* Currently only fetching branding information.
|
|
862
|
+
* You can call this method after configuring the SDK to speed
|
|
863
|
+
* up the first call to {@link Purchases.purchase}.
|
|
864
|
+
*/
|
|
865
|
+
preload(): Promise<void>;
|
|
866
|
+
/**
|
|
867
|
+
* Fetch the configured offerings for this user. You can configure these
|
|
868
|
+
* in the RevenueCat dashboard.
|
|
869
|
+
* @param params - The parameters object to customise the offerings fetch. Check {@link GetOfferingsParams}
|
|
870
|
+
*/
|
|
871
|
+
getOfferings(params?: GetOfferingsParams): Promise<Offerings>;
|
|
880
872
|
/**
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
*
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
*
|
|
890
|
-
*
|
|
873
|
+
* Retrieves a specific offering by a placement identifier.
|
|
874
|
+
* For more info see https://www.revenuecat.com/docs/tools/targeting
|
|
875
|
+
* @param placementIdentifier - The placement identifier to retrieve the offering for.
|
|
876
|
+
* @param params - The parameters object to customise the offerings fetch. Check {@link GetOfferingsParams}
|
|
877
|
+
*/
|
|
878
|
+
getCurrentOfferingForPlacement(placementIdentifier: string, params?: GetOfferingsParams): Promise<Offering | null>;
|
|
879
|
+
private getAllOfferings;
|
|
880
|
+
/**
|
|
881
|
+
* Convenience method to check whether a user is entitled to a specific
|
|
882
|
+
* entitlement. This will use {@link Purchases.getCustomerInfo} under the hood.
|
|
883
|
+
* @param entitlementIdentifier - The entitlement identifier you want to check.
|
|
884
|
+
* @returns Whether the user is entitled to the specified entitlement
|
|
885
|
+
* @throws {@link PurchasesError} if there is an error while fetching the customer info.
|
|
886
|
+
* @see {@link Purchases.getCustomerInfo}
|
|
891
887
|
*/
|
|
892
|
-
|
|
888
|
+
isEntitledTo(entitlementIdentifier: string): Promise<boolean>;
|
|
893
889
|
/**
|
|
894
890
|
* Method to perform a purchase for a given package. You can obtain the
|
|
895
891
|
* package from {@link Purchases.getOfferings}. This method will present the purchase
|
|
896
892
|
* form on your site, using the given HTML element as the mount point, if
|
|
897
893
|
* provided, or as a modal if not.
|
|
898
|
-
* @
|
|
899
|
-
* @
|
|
894
|
+
* @deprecated - please use .purchase
|
|
895
|
+
* @param rcPackage - The package you want to purchase. Obtained from {@link Purchases.getOfferings}.
|
|
896
|
+
* @param customerEmail - The email of the user. If undefined, RevenueCat will ask the customer for their email.
|
|
897
|
+
* @param htmlTarget - The HTML element where the billing view should be added. If undefined, a new div will be created at the root of the page and appended to the body.
|
|
898
|
+
* @returns a Promise for the customer info after the purchase is completed successfully.
|
|
900
899
|
* @throws {@link PurchasesError} if there is an error while performing the purchase. If the {@link PurchasesError.errorCode} is {@link ErrorCode.UserCancelledError}, the user cancelled the purchase.
|
|
901
900
|
*/
|
|
902
|
-
|
|
901
|
+
purchasePackage(rcPackage: Package, customerEmail?: string, htmlTarget?: HTMLElement): Promise<PurchaseResult>;
|
|
903
902
|
/**
|
|
904
|
-
*
|
|
905
|
-
*
|
|
906
|
-
*
|
|
903
|
+
* Method to perform a purchase for a given package. You can obtain the
|
|
904
|
+
* package from {@link Purchases.getOfferings}. This method will present the purchase
|
|
905
|
+
* form on your site, using the given HTML element as the mount point, if
|
|
906
|
+
* provided, or as a modal if not.
|
|
907
|
+
* @param params - The parameters object to customise the purchase flow. Check {@link PurchaseParams}
|
|
908
|
+
* @returns a Promise for the customer and redemption info after the purchase is completed successfully.
|
|
909
|
+
* @throws {@link PurchasesError} if there is an error while performing the purchase. If the {@link PurchasesError.errorCode} is {@link ErrorCode.UserCancelledError}, the user cancelled the purchase.
|
|
907
910
|
*/
|
|
908
|
-
|
|
909
|
-
/**
|
|
910
|
-
* Gets the current app user id.
|
|
911
|
-
*/
|
|
912
|
-
getAppUserId(): string;
|
|
911
|
+
purchase(params: PurchaseParams): Promise<PurchaseResult>;
|
|
913
912
|
/**
|
|
914
|
-
*
|
|
915
|
-
*
|
|
916
|
-
*
|
|
917
|
-
* Note: Unlike our mobile SDKs, the web SDK does not cache or retry sending attributes if the request fails. If the request fails, the attributes will not be saved and you will need to retry the operation.
|
|
918
|
-
*
|
|
919
|
-
* @param attributes - A dictionary of attributes to set for the current user.
|
|
920
|
-
* @throws {@link PurchasesError} if there is an error while setting the attributes or if the customer doesn't exist.
|
|
913
|
+
* Gets latest available {@link CustomerInfo}.
|
|
914
|
+
* @returns The latest {@link CustomerInfo}.
|
|
915
|
+
* @throws {@link PurchasesError} if there is an error while fetching the customer info.
|
|
921
916
|
*/
|
|
922
|
-
|
|
923
|
-
[key: string | ReservedCustomerAttribute]: string | null;
|
|
924
|
-
}): Promise<void>;
|
|
917
|
+
getCustomerInfo(): Promise<CustomerInfo>;
|
|
925
918
|
/**
|
|
926
|
-
*
|
|
927
|
-
* user id.
|
|
928
|
-
* @param newAppUserId - The user id to change to.
|
|
919
|
+
* Gets the current app user id.
|
|
929
920
|
*/
|
|
930
|
-
|
|
921
|
+
getAppUserId(): string;
|
|
931
922
|
/**
|
|
932
|
-
*
|
|
933
|
-
|
|
934
|
-
|
|
923
|
+
* Sets attributes for the current user. Attributes are useful for storing additional, structured information on a customer that can be used elsewhere in the system.
|
|
924
|
+
* For example, you could store your customer's email address or additional system identifiers through the applicable reserved attributes, or store arbitrary facts like onboarding survey responses, feature usage, or other dimensions as custom attributes.
|
|
925
|
+
*
|
|
926
|
+
* Note: Unlike our mobile SDKs, the web SDK does not cache or retry sending attributes if the request fails. If the request fails, the attributes will not be saved and you will need to retry the operation.
|
|
927
|
+
*
|
|
928
|
+
* @param attributes - A dictionary of attributes to set for the current user.
|
|
929
|
+
* @throws {@link PurchasesError} if there is an error while setting the attributes or if the customer doesn't exist.
|
|
930
|
+
*/
|
|
931
|
+
setAttributes(attributes: {
|
|
932
|
+
[key: string | ReservedCustomerAttribute]: string | null;
|
|
933
|
+
}): Promise<void>;
|
|
934
|
+
/**
|
|
935
|
+
* Change the current app user id. Returns the customer info for the new
|
|
936
|
+
* user id.
|
|
937
|
+
* @param newAppUserId - The user id to change to.
|
|
938
|
+
*/
|
|
939
|
+
changeUser(newAppUserId: string): Promise<CustomerInfo>;
|
|
940
|
+
/**
|
|
941
|
+
* @returns Whether the SDK is using a sandbox API Key.
|
|
942
|
+
*/
|
|
943
|
+
isSandbox(): boolean;
|
|
944
|
+
/**
|
|
945
|
+
* @returns Whether the current user is anonymous.
|
|
946
|
+
*/
|
|
947
|
+
isAnonymous(): boolean;
|
|
948
|
+
/**
|
|
949
|
+
* Closes the Purchases instance. You should never have to do this normally.
|
|
950
|
+
*/
|
|
951
|
+
close(): void;
|
|
952
|
+
/**
|
|
953
|
+
* Generates an anonymous app user ID that follows RevenueCat's format.
|
|
954
|
+
* This can be used when you don't have a user identifier system in place.
|
|
955
|
+
* The generated ID will be in the format: $RCAnonymousID:\<UUID without dashes\>
|
|
956
|
+
* Example: $RCAnonymousID:123e4567e89b12d3a456426614174000
|
|
957
|
+
* @returns A new anonymous app user ID string
|
|
958
|
+
* @public
|
|
959
|
+
*/
|
|
960
|
+
static generateRevenueCatAnonymousAppUserId(): string;
|
|
961
|
+
}
|
|
962
|
+
|
|
935
963
|
/**
|
|
936
|
-
*
|
|
964
|
+
* Configuration object for initializing the Purchases SDK.
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
967
|
+
* ```typescript
|
|
968
|
+
* // Object-based configuration (recommended)
|
|
969
|
+
* const purchases = Purchases.configure({
|
|
970
|
+
* apiKey: "your_api_key",
|
|
971
|
+
* appUserId: "user_123",
|
|
972
|
+
* httpConfig: { additionalHeaders: { "Custom-Header": "value" } },
|
|
973
|
+
* flags: { autoCollectUTMAsMetadata: true }
|
|
974
|
+
* });
|
|
975
|
+
*
|
|
976
|
+
* // Legacy separate arguments (deprecated)
|
|
977
|
+
* const purchases = Purchases.configure(
|
|
978
|
+
* "your_api_key",
|
|
979
|
+
* "user_123",
|
|
980
|
+
* { additionalHeaders: { "Custom-Header": "value" } },
|
|
981
|
+
* { autoCollectUTMAsMetadata: true }
|
|
982
|
+
* );
|
|
983
|
+
* ```
|
|
984
|
+
*
|
|
985
|
+
* @public
|
|
937
986
|
*/
|
|
938
|
-
|
|
987
|
+
export declare interface PurchasesConfig {
|
|
988
|
+
/**
|
|
989
|
+
* RevenueCat API Key. Can be obtained from the RevenueCat dashboard.
|
|
990
|
+
*/
|
|
991
|
+
apiKey: string;
|
|
992
|
+
/**
|
|
993
|
+
* Your unique id for identifying the user.
|
|
994
|
+
*/
|
|
995
|
+
appUserId: string;
|
|
996
|
+
/**
|
|
997
|
+
* Advanced http configuration to customise the SDK usage {@link HttpConfig}.
|
|
998
|
+
*/
|
|
999
|
+
httpConfig?: HttpConfig;
|
|
1000
|
+
/**
|
|
1001
|
+
* Advanced functionality configuration {@link FlagsConfig}.
|
|
1002
|
+
*/
|
|
1003
|
+
flags?: FlagsConfig;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
939
1006
|
/**
|
|
940
|
-
*
|
|
1007
|
+
* Error class for Purchases SDK. You should handle these errors and react
|
|
1008
|
+
* accordingly in your app.
|
|
1009
|
+
* @public
|
|
941
1010
|
*/
|
|
942
|
-
|
|
1011
|
+
export declare class PurchasesError extends Error {
|
|
1012
|
+
/**
|
|
1013
|
+
* Error code for the error. This is useful to appropriately react to
|
|
1014
|
+
* different error situations.
|
|
1015
|
+
*/
|
|
1016
|
+
readonly errorCode: ErrorCode;
|
|
1017
|
+
/**
|
|
1018
|
+
* Underlying error message. This provides more details on the error and
|
|
1019
|
+
* can be useful for debugging and logging.
|
|
1020
|
+
*/
|
|
1021
|
+
readonly underlyingErrorMessage?: string | null | undefined;
|
|
1022
|
+
/**
|
|
1023
|
+
* Contains extra information that is available in certain types of errors.
|
|
1024
|
+
*/
|
|
1025
|
+
readonly extra?: PurchasesErrorExtra | undefined;
|
|
1026
|
+
constructor(
|
|
1027
|
+
/**
|
|
1028
|
+
* Error code for the error. This is useful to appropriately react to
|
|
1029
|
+
* different error situations.
|
|
1030
|
+
*/
|
|
1031
|
+
errorCode: ErrorCode,
|
|
1032
|
+
/**
|
|
1033
|
+
* Message for the error. This is useful for debugging and logging.
|
|
1034
|
+
*/
|
|
1035
|
+
message?: string,
|
|
1036
|
+
/**
|
|
1037
|
+
* Underlying error message. This provides more details on the error and
|
|
1038
|
+
* can be useful for debugging and logging.
|
|
1039
|
+
*/
|
|
1040
|
+
underlyingErrorMessage?: string | null | undefined,
|
|
1041
|
+
/**
|
|
1042
|
+
* Contains extra information that is available in certain types of errors.
|
|
1043
|
+
*/
|
|
1044
|
+
extra?: PurchasesErrorExtra | undefined);
|
|
1045
|
+
toString: () => string;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
943
1048
|
/**
|
|
944
|
-
*
|
|
945
|
-
* This can be used when you don't have a user identifier system in place.
|
|
946
|
-
* The generated ID will be in the format: $RCAnonymousID:\<UUID without dashes\>
|
|
947
|
-
* Example: $RCAnonymousID:123e4567e89b12d3a456426614174000
|
|
948
|
-
* @returns A new anonymous app user ID string
|
|
1049
|
+
* Extra information that is available in certain types of errors.
|
|
949
1050
|
* @public
|
|
950
1051
|
*/
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
* Error code for the error. This is useful to appropriately react to
|
|
962
|
-
* different error situations.
|
|
963
|
-
*/
|
|
964
|
-
readonly errorCode: ErrorCode;
|
|
965
|
-
/**
|
|
966
|
-
* Underlying error message. This provides more details on the error and
|
|
967
|
-
* can be useful for debugging and logging.
|
|
968
|
-
*/
|
|
969
|
-
readonly underlyingErrorMessage?: string | null | undefined;
|
|
970
|
-
/**
|
|
971
|
-
* Contains extra information that is available in certain types of errors.
|
|
972
|
-
*/
|
|
973
|
-
readonly extra?: PurchasesErrorExtra | undefined;
|
|
974
|
-
constructor(
|
|
975
|
-
/**
|
|
976
|
-
* Error code for the error. This is useful to appropriately react to
|
|
977
|
-
* different error situations.
|
|
978
|
-
*/
|
|
979
|
-
errorCode: ErrorCode,
|
|
980
|
-
/**
|
|
981
|
-
* Message for the error. This is useful for debugging and logging.
|
|
982
|
-
*/
|
|
983
|
-
message?: string,
|
|
984
|
-
/**
|
|
985
|
-
* Underlying error message. This provides more details on the error and
|
|
986
|
-
* can be useful for debugging and logging.
|
|
987
|
-
*/
|
|
988
|
-
underlyingErrorMessage?: string | null | undefined,
|
|
989
|
-
/**
|
|
990
|
-
* Contains extra information that is available in certain types of errors.
|
|
991
|
-
*/
|
|
992
|
-
extra?: PurchasesErrorExtra | undefined);
|
|
993
|
-
toString: () => string;
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
/**
|
|
997
|
-
* Extra information that is available in certain types of errors.
|
|
998
|
-
* @public
|
|
999
|
-
*/
|
|
1000
|
-
export declare interface PurchasesErrorExtra {
|
|
1001
|
-
/**
|
|
1002
|
-
* If this is a request error, the HTTP status code of the response.
|
|
1003
|
-
*/
|
|
1004
|
-
readonly statusCode?: number;
|
|
1005
|
-
/**
|
|
1006
|
-
* If this is a RevenueCat backend error, the error code from the servers.
|
|
1007
|
-
*/
|
|
1008
|
-
readonly backendErrorCode?: number;
|
|
1009
|
-
}
|
|
1052
|
+
export declare interface PurchasesErrorExtra {
|
|
1053
|
+
/**
|
|
1054
|
+
* If this is a request error, the HTTP status code of the response.
|
|
1055
|
+
*/
|
|
1056
|
+
readonly statusCode?: number;
|
|
1057
|
+
/**
|
|
1058
|
+
* If this is a RevenueCat backend error, the error code from the servers.
|
|
1059
|
+
*/
|
|
1060
|
+
readonly backendErrorCode?: number;
|
|
1061
|
+
}
|
|
1010
1062
|
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1063
|
+
/**
|
|
1064
|
+
* This object gives you access to the purchase redemption data when
|
|
1065
|
+
* the purchase can be redeemed to a mobile user, like in the case of anonymous users.
|
|
1066
|
+
* @public
|
|
1067
|
+
*/
|
|
1068
|
+
export declare interface RedemptionInfo {
|
|
1069
|
+
/**
|
|
1070
|
+
* The redeem url.
|
|
1071
|
+
*/
|
|
1072
|
+
readonly redeemUrl: string | null;
|
|
1073
|
+
}
|
|
1022
1074
|
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1075
|
+
/**
|
|
1076
|
+
* Enumeration of reserved customer attributes.
|
|
1077
|
+
* @public
|
|
1078
|
+
*/
|
|
1079
|
+
export declare enum ReservedCustomerAttribute {
|
|
1080
|
+
/**
|
|
1081
|
+
* The display name that should be used to reference the customer.
|
|
1082
|
+
*/
|
|
1083
|
+
DisplayName = "$displayName",
|
|
1084
|
+
/**
|
|
1085
|
+
* The email address of the customer.
|
|
1086
|
+
*/
|
|
1087
|
+
Email = "$email",
|
|
1088
|
+
/**
|
|
1089
|
+
* The phone number of the customer.
|
|
1090
|
+
*/
|
|
1091
|
+
PhoneNumber = "$phoneNumber",
|
|
1092
|
+
/**
|
|
1093
|
+
* iOS advertising identifier UUID for the customer.
|
|
1094
|
+
*/
|
|
1095
|
+
IDFA = "$idfa",
|
|
1096
|
+
/**
|
|
1097
|
+
* iOS vendor identifier UUID for the customer.
|
|
1098
|
+
*/
|
|
1099
|
+
IDFV = "$idfv",
|
|
1100
|
+
/**
|
|
1101
|
+
* The advertising ID that is provided by Google Play services for the customer.
|
|
1102
|
+
*/
|
|
1103
|
+
GPSAdId = "$gpsAdId",
|
|
1104
|
+
/**
|
|
1105
|
+
* The Android ID of the customer.
|
|
1106
|
+
*/
|
|
1107
|
+
AndroidId = "$androidId",
|
|
1108
|
+
/**
|
|
1109
|
+
* The Amazon Advertising ID of the customer.
|
|
1110
|
+
*/
|
|
1111
|
+
AmazonAdId = "$amazonAdId",
|
|
1112
|
+
/**
|
|
1113
|
+
* The IP address of the customer.
|
|
1114
|
+
*/
|
|
1115
|
+
IP = "$ip",
|
|
1116
|
+
/**
|
|
1117
|
+
* The unique Adjust identifier for the customer.
|
|
1118
|
+
*/
|
|
1119
|
+
AdjustId = "$adjustId",
|
|
1120
|
+
/**
|
|
1121
|
+
* The Amplitude device ID of the customer.
|
|
1122
|
+
*/
|
|
1123
|
+
AmplitudeDeviceId = "$amplitudeDeviceId",
|
|
1124
|
+
/**
|
|
1125
|
+
* The Amplitude user ID of the customer.
|
|
1126
|
+
*/
|
|
1127
|
+
AmplitudeUserId = "$amplitudeUserId",
|
|
1128
|
+
/**
|
|
1129
|
+
* Appsflyer Id. The unique Appsflyer identifier for the customer.
|
|
1130
|
+
*/
|
|
1131
|
+
AppsflyerId = "$appsflyerId",
|
|
1132
|
+
/**
|
|
1133
|
+
* The AppsFlyer sharing filter of the customer.
|
|
1134
|
+
*/
|
|
1135
|
+
AppsflyerSharingFilter = "$appsflyerSharingFilter",
|
|
1136
|
+
/**
|
|
1137
|
+
* The Branch ID of the customer.
|
|
1138
|
+
*/
|
|
1139
|
+
BranchId = "$branchId",
|
|
1140
|
+
/**
|
|
1141
|
+
* The Braze 'alias_name' in User Alias Object.
|
|
1142
|
+
*/
|
|
1143
|
+
BrazeAliasName = "$brazeAliasName",
|
|
1144
|
+
/**
|
|
1145
|
+
* The Braze 'alias_label' in User Alias Object.
|
|
1146
|
+
*/
|
|
1147
|
+
BrazeAliasLabel = "$brazeAliasLabel",
|
|
1148
|
+
/**
|
|
1149
|
+
* The CleverTap ID of the customer.
|
|
1150
|
+
*/
|
|
1151
|
+
ClevertapId = "$clevertapId",
|
|
1152
|
+
/**
|
|
1153
|
+
* The Facebook anonymous ID of the customer.
|
|
1154
|
+
*/
|
|
1155
|
+
FbAnonId = "$fbAnonId",
|
|
1156
|
+
/**
|
|
1157
|
+
* The unique mParticle user identifier (mpid).
|
|
1158
|
+
*/
|
|
1159
|
+
MparticleId = "$mparticleId",
|
|
1160
|
+
/**
|
|
1161
|
+
* The OneSignal Player Id for the customer.
|
|
1162
|
+
*/
|
|
1163
|
+
OnesignalId = "$onesignalId",
|
|
1164
|
+
/**
|
|
1165
|
+
* The OneSignal user ID of the customer.
|
|
1166
|
+
*/
|
|
1167
|
+
OnesignalUserId = "$onesignalUserId",
|
|
1168
|
+
/**
|
|
1169
|
+
* The Intercom contact ID of the customer.
|
|
1170
|
+
*/
|
|
1171
|
+
IntercomContactId = "$intercomContactId",
|
|
1172
|
+
/**
|
|
1173
|
+
* The media source of the customer.
|
|
1174
|
+
*/
|
|
1175
|
+
MediaSource = "$mediaSource",
|
|
1176
|
+
/**
|
|
1177
|
+
* The campaign of the customer.
|
|
1178
|
+
*/
|
|
1179
|
+
Campaign = "$campaign",
|
|
1180
|
+
/**
|
|
1181
|
+
* The ad group of the customer.
|
|
1182
|
+
*/
|
|
1183
|
+
AdGroup = "$adGroup",
|
|
1184
|
+
/**
|
|
1185
|
+
* The Ad ID of the customer.
|
|
1186
|
+
*/
|
|
1187
|
+
AdId = "$ad",
|
|
1188
|
+
/**
|
|
1189
|
+
* The keyword of the customer.
|
|
1190
|
+
*/
|
|
1191
|
+
Keyword = "$keyword",
|
|
1192
|
+
/**
|
|
1193
|
+
* The creative of the customer.
|
|
1194
|
+
*/
|
|
1195
|
+
Creative = "$creative",
|
|
1196
|
+
/**
|
|
1197
|
+
* Apple push notification tokens for the customer.
|
|
1198
|
+
*/
|
|
1199
|
+
APNSTokens = "$apnsTokens",
|
|
1200
|
+
/**
|
|
1201
|
+
* Google push notification tokens for the customer.
|
|
1202
|
+
*/
|
|
1203
|
+
FCMTokens = "$fcmTokens",
|
|
1204
|
+
/**
|
|
1205
|
+
* The Airship channel ID of the customer.
|
|
1206
|
+
*/
|
|
1207
|
+
AirshipChannelId = "$airshipChannelId",
|
|
1208
|
+
/**
|
|
1209
|
+
* The segment ID of the customer.
|
|
1210
|
+
*/
|
|
1211
|
+
SegmentId = "$segmentId",
|
|
1212
|
+
/**
|
|
1213
|
+
* The Iterable user ID of the customer.
|
|
1214
|
+
*/
|
|
1215
|
+
IterableUserId = "$iterableUserId",
|
|
1216
|
+
/**
|
|
1217
|
+
* The Iterable campaign ID of the customer.
|
|
1218
|
+
*/
|
|
1219
|
+
IterableCampaignId = "$iterableCampaignId",
|
|
1220
|
+
/**
|
|
1221
|
+
* The Iterable template ID of the customer.
|
|
1222
|
+
*/
|
|
1223
|
+
IterableTemplateId = "$iterableTemplateId",
|
|
1224
|
+
/**
|
|
1225
|
+
* The Firebase app instance ID of the customer.
|
|
1226
|
+
*/
|
|
1227
|
+
FirebaseAppInstanceId = "$firebaseAppInstanceId",
|
|
1228
|
+
/**
|
|
1229
|
+
* The Mixpanel distinct ID of the customer.
|
|
1230
|
+
*/
|
|
1231
|
+
MixpanelDistinctId = "$mixpanelDistinctId",
|
|
1232
|
+
/**
|
|
1233
|
+
* Apple App Tracking Transparency consent status for the customer.
|
|
1234
|
+
*/
|
|
1235
|
+
ATTConsentStatus = "$attConsentStatus",
|
|
1236
|
+
/**
|
|
1237
|
+
* The unique Kochava device identifier of the customer.
|
|
1238
|
+
*/
|
|
1239
|
+
KochavaDeviceId = "$kochavaDeviceId",
|
|
1240
|
+
/**
|
|
1241
|
+
* The device version of the customer.
|
|
1242
|
+
*/
|
|
1243
|
+
DeviceVersion = "$deviceVersion",
|
|
1244
|
+
/**
|
|
1245
|
+
* The PostHog user ID of the customer.
|
|
1246
|
+
*/
|
|
1247
|
+
PosthogUserId = "$posthogUserId",
|
|
1248
|
+
/**
|
|
1249
|
+
* The Telemetry Deck user ID of the customer.
|
|
1250
|
+
*/
|
|
1251
|
+
TelemetryDeckUserId = "$telemetryDeckUserId",
|
|
1252
|
+
/**
|
|
1253
|
+
* The Telemetry Deck app ID of the customer.
|
|
1254
|
+
*/
|
|
1255
|
+
TelemetryDeckAppId = "$telemetryDeckAppId",
|
|
1256
|
+
/**
|
|
1257
|
+
* The Apple refund handling preference of the customer.
|
|
1258
|
+
*/
|
|
1259
|
+
AppleRefundHandlingPreference = "$appleRefundHandlingPreference",
|
|
1260
|
+
/**
|
|
1261
|
+
* The customer.io ID of the customer.
|
|
1262
|
+
*/
|
|
1263
|
+
CustomerioId = "$customerioId",
|
|
1264
|
+
/**
|
|
1265
|
+
* The Tenjin ID of the customer.
|
|
1266
|
+
*/
|
|
1267
|
+
TenjinId = "$tenjinId"
|
|
1268
|
+
}
|
|
1217
1269
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1270
|
+
/**
|
|
1271
|
+
* The store where the user originally subscribed.
|
|
1272
|
+
* @public
|
|
1273
|
+
*/
|
|
1274
|
+
export declare type Store = "app_store" | "mac_app_store" | "play_store" | "amazon" | "stripe" | "rc_billing" | "promotional" | "paddle" | "unknown";
|
|
1223
1275
|
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1276
|
+
/**
|
|
1277
|
+
* Subscription purchases of the Customer.
|
|
1278
|
+
* @public
|
|
1279
|
+
*/
|
|
1280
|
+
export declare interface SubscriptionInfo {
|
|
1281
|
+
/**
|
|
1282
|
+
* The product identifier.
|
|
1283
|
+
*/
|
|
1284
|
+
readonly productIdentifier: string;
|
|
1285
|
+
/**
|
|
1286
|
+
* Date when the last subscription period started.
|
|
1287
|
+
*/
|
|
1288
|
+
readonly purchaseDate: Date;
|
|
1289
|
+
/**
|
|
1290
|
+
* Date when this subscription first started. This property does not update with renewals.
|
|
1291
|
+
* This property also does not update for product changes within a subscription group or
|
|
1292
|
+
* re-subscriptions by lapsed subscribers.
|
|
1293
|
+
*/
|
|
1294
|
+
readonly originalPurchaseDate: Date | null;
|
|
1295
|
+
/**
|
|
1296
|
+
* Date when the subscription expires/expired
|
|
1297
|
+
*/
|
|
1298
|
+
readonly expiresDate: Date | null;
|
|
1299
|
+
/**
|
|
1300
|
+
* Store where the subscription was purchased.
|
|
1301
|
+
*/
|
|
1302
|
+
readonly store: Store;
|
|
1303
|
+
/**
|
|
1304
|
+
* Date when RevenueCat detected that auto-renewal was turned off for this subscription.
|
|
1305
|
+
* Note the subscription may still be active, check the {@link SubscriptionInfo.expiresDate} attribute.
|
|
1306
|
+
*/
|
|
1307
|
+
readonly unsubscribeDetectedAt: Date | null;
|
|
1308
|
+
/**
|
|
1309
|
+
* Whether or not the purchase was made in sandbox mode.
|
|
1310
|
+
*/
|
|
1311
|
+
readonly isSandbox: boolean;
|
|
1312
|
+
/**
|
|
1313
|
+
* Date when RevenueCat detected any billing issues with this subscription.
|
|
1314
|
+
* If and when the billing issue gets resolved, this field is set to null.
|
|
1315
|
+
* Note the subscription may still be active, check the {@link SubscriptionInfo.expiresDate} attribute.
|
|
1316
|
+
*/
|
|
1317
|
+
readonly billingIssuesDetectedAt: Date | null;
|
|
1318
|
+
/**
|
|
1319
|
+
* Date when any grace period for this subscription expires/expired.
|
|
1320
|
+
* null if the customer has never been in a grace period.
|
|
1321
|
+
*/
|
|
1322
|
+
readonly gracePeriodExpiresDate: Date | null;
|
|
1323
|
+
/**
|
|
1324
|
+
* How the Customer received access to this subscription:
|
|
1325
|
+
* - "PURCHASED": The customer bought the subscription.
|
|
1326
|
+
* - "FAMILY_SHARED": The customer has access to the product via their family.
|
|
1327
|
+
*/
|
|
1328
|
+
readonly ownershipType: OwnershipType;
|
|
1329
|
+
/**
|
|
1330
|
+
* Type of the current subscription period:
|
|
1331
|
+
* - "normal": The product is in a normal period (default)
|
|
1332
|
+
* - "trial": The product is in a free trial period
|
|
1333
|
+
* - "intro": The product is in an introductory pricing period
|
|
1334
|
+
* - "prepaid": The product is in a prepaid pricing period
|
|
1335
|
+
*/
|
|
1336
|
+
readonly periodType: PeriodType;
|
|
1337
|
+
/**
|
|
1338
|
+
* Date when RevenueCat detected a refund of this subscription.
|
|
1339
|
+
*/
|
|
1340
|
+
readonly refundedAt: Date | null;
|
|
1341
|
+
/**
|
|
1342
|
+
* The transaction id in the store of the subscription.
|
|
1343
|
+
*/
|
|
1344
|
+
readonly storeTransactionId: string | null;
|
|
1345
|
+
/**
|
|
1346
|
+
* Whether the subscription is currently active
|
|
1347
|
+
* (at the time this object was obtained).
|
|
1348
|
+
*/
|
|
1349
|
+
readonly isActive: boolean;
|
|
1350
|
+
/**
|
|
1351
|
+
* Whether the subscription will renew at the next billing period.
|
|
1352
|
+
*/
|
|
1353
|
+
readonly willRenew: boolean;
|
|
1354
|
+
}
|
|
1303
1355
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1356
|
+
/**
|
|
1357
|
+
* Represents a possible option to purchase a subscription product.
|
|
1358
|
+
* @public
|
|
1359
|
+
*/
|
|
1360
|
+
export declare interface SubscriptionOption extends PurchaseOption {
|
|
1361
|
+
/**
|
|
1362
|
+
* The base phase for a SubscriptionOption, represents
|
|
1363
|
+
* the price that the customer will be charged after all the discounts have
|
|
1364
|
+
* been consumed and the period at which it will renew.
|
|
1365
|
+
*/
|
|
1366
|
+
readonly base: PricingPhase;
|
|
1367
|
+
/**
|
|
1368
|
+
* The trial information for this subscription option if available.
|
|
1369
|
+
*/
|
|
1370
|
+
readonly trial: PricingPhase | null;
|
|
1371
|
+
}
|
|
1320
1372
|
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1373
|
+
/**
|
|
1374
|
+
* Contains information about the targeting context used to obtain an object.
|
|
1375
|
+
* @public
|
|
1376
|
+
*/
|
|
1377
|
+
export declare interface TargetingContext {
|
|
1378
|
+
/**
|
|
1379
|
+
* The rule id from the targeting used to obtain this object.
|
|
1380
|
+
*/
|
|
1381
|
+
readonly ruleId: string;
|
|
1382
|
+
/**
|
|
1383
|
+
* The revision of the targeting used to obtain this object.
|
|
1384
|
+
*/
|
|
1385
|
+
readonly revision: number;
|
|
1386
|
+
}
|
|
1335
1387
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1388
|
+
/**
|
|
1389
|
+
* Error indicating that the SDK was accessed before it was initialized.
|
|
1390
|
+
* @public
|
|
1391
|
+
*/
|
|
1392
|
+
export declare class UninitializedPurchasesError extends Error {
|
|
1393
|
+
constructor();
|
|
1394
|
+
}
|
|
1343
1395
|
|
|
1344
|
-
|
|
1396
|
+
export { }
|