@@ -92,3 +92,61 @@ export function setTokenAutoRefreshEnabled(
92
92
export class CustomProvider implements AppCheckProvider {
93
93
constructor ( customProviderOptions : CustomProviderOptions ) ;
94
94
}
95
+
96
+ /**
97
+ * React-Native-Firebase AppCheckProvider that allows hot-swapping native AppCheck implementations
98
+ */
99
+ export interface ReactNativeFirebaseAppCheckProviderOptions {
100
+ /**
101
+ * debug token to use, if any. Defaults to undefined, pre-configure tokens in firebase web console if needed
102
+ */
103
+ debugToken ?: string ;
104
+ }
105
+
106
+ export interface ReactNativeFirebaseAppCheckProviderWebOptions
107
+ extends ReactNativeFirebaseAppCheckProviderOptions {
108
+ /**
109
+ * The web provider to use, either `reCaptchaV3` or `reCaptchaEnterprise`, defaults to `reCaptchaV3`
110
+ */
111
+ provider ?: 'debug' | 'reCaptchaV3' | 'reCaptchaEnterprise' ;
112
+
113
+ /**
114
+ * siteKey for use in web queries, defaults to `none`
115
+ */
116
+ siteKey ?: string ;
117
+ }
118
+
119
+ export interface ReactNativeFirebaseAppCheckProviderAppleOptions
120
+ extends ReactNativeFirebaseAppCheckProviderOptions {
121
+ /**
122
+ * The apple provider to use, either `deviceCheck` or `appAttest`, or `appAttestWithDeviceCheckFallback`,
123
+ * defaults to `DeviceCheck`. `appAttest` requires iOS 14+ or will fail, `appAttestWithDeviceCheckFallback`
124
+ * will use `appAttest` for iOS14+ and fallback to `deviceCheck` on devices with ios13 and lower
125
+ */
126
+ provider ?: 'debug' | 'deviceCheck' | 'appAttest' | 'appAttestWithDeviceCheckFallback' ;
127
+ }
128
+
129
+ export interface ReactNativeFirebaseAppCheckProviderAndroidOptions
130
+ extends ReactNativeFirebaseAppCheckProviderOptions {
131
+ /**
132
+ * The android provider to use, either `debug` or `playIntegrity`. default is `playIntegrity`.
133
+ */
134
+ provider ?: 'debug' | 'playIntegrity' ;
135
+ }
136
+
137
+ export class ReactNativeFirebaseAppCheckProvider extends AppCheckProvider {
138
+ /**
139
+ * Specify how the app check provider should be configured. The new configuration is
140
+ * in effect when this call returns. You must call `getToken()`
141
+ * after this call to get a token using the new configuration.
142
+ * This custom provider allows for delayed configuration and re-configuration on all platforms
143
+ * so AppCheck has the same experience across all platforms, with the only difference being the native
144
+ * providers you choose to use on each platform.
145
+ */
146
+ configure ( options : {
147
+ web ?: ReactNativeFirebaseAppCheckProviderWebOptions ;
148
+ android ?: ReactNativeFirebaseAppCheckProviderAndroidOptions ;
149
+ apple ?: ReactNativeFirebaseAppCheckProviderAppleOptions ;
150
+ isTokenAutoRefreshEnabled ?: boolean ;
151
+ } ) : void ;
152
+ }
0 commit comments