Index
Methods
activate
- 
							Activate AppCheck Parameters- 
									provider: ReCaptchaV3Provider | ReCaptchaEnterpriseProvider | CustomProvider | AppCheckProvider | { getToken: () => AppCheckToken } | stringThis can be a ReCaptchaV3Providerinstance, aReCaptchaEnterpriseProviderinstance, aCustomProviderinstance, an object with a customgetToken()method, or a reCAPTCHA site key.
- 
									Optional isTokenAutoRefreshEnabled: booleanIf true, the SDK automatically refreshes App Check tokens as needed. If undefined, defaults to the value of app.automaticDataCollectionEnabled, which defaults to false and can be set in the app config.
 Returns void
- 
									
getToken 
					- 
							Get the current App Check token. Attaches to the most recent in-flight request if one is present. Returns null if no token is present and no token requests are in-flight. Parameters- 
									Optional forceRefresh: booleanIf true, will always try to fetch a fresh token. If false, will use a cached token if found in storage. 
 Returns Promise<AppCheckTokenResult>
- 
									
onTokenChanged  
					- 
							Registers a listener to changes in the token state. There can be more than one listener registered at the same time for one or more App Check instances. The listeners call back on the UI thread whenever the current token associated with this App Check instance changes. Parameters- 
									observer: { complete?: () => void; error?: (error: Error) => void; next: (tokenResult: AppCheckTokenResult) => void }An object with next,error, andcompleteproperties.nextis called with anAppCheckTokenResultwhenever the token changes.erroris optional and is called if an error is thrown by the listener (thenextfunction).completeis unused, as the token stream is unending.- 
											Optional complete?: () => void- 
													- 
															Returns void
 
- 
															
 
- 
													
- 
											Optional error?: (error: Error) => void- 
													- 
															Parameters- 
																	error: Error
 Returns void
- 
																	
 
- 
															
 
- 
													
- 
											next: (tokenResult: AppCheckTokenResult) => void- 
													- 
															Parameters- 
																	tokenResult: AppCheckTokenResult
 Returns void
- 
																	
 
- 
															
 
- 
													
 
- 
											
 Returns UnsubscribeA function that unsubscribes this listener. 
- 
									
- 
							Registers a listener to changes in the token state. There can be more than one listener registered at the same time for one or more App Check instances. The listeners call back on the UI thread whenever the current token associated with this App Check instance changes. Parameters- 
									onNext: (tokenResult: AppCheckTokenResult) => voidWhen the token changes, this function is called with aa AppCheckTokenResult.- 
											- 
													Parameters- 
															tokenResult: AppCheckTokenResult
 Returns void
- 
															
 
- 
													
 
- 
											
- 
									Optional onError: (error: Error) => voidOptional. Called if there is an error thrown by the listener (the onNextfunction).- 
											- 
													Parameters- 
															error: Error
 Returns void
- 
															
 
- 
													
 
- 
											
- 
									Optional onCompletion: () => voidCurrently unused, as the token stream is unending. - 
											- 
													Returns void
 
- 
													
 
- 
											
 Returns UnsubscribeA function that unsubscribes this listener. 
- 
									
setTokenAutoRefreshEnabled    
					- 
							Parameters- 
									isTokenAutoRefreshEnabled: booleanIf true, the SDK automatically refreshes App Check tokens as needed. This overrides any value set during activate().
 Returns void
- 
									
The Firebase AppCheck service interface.
Do not call this constructor directly. Instead, use
firebase.appCheck().