Skip to content

Commit f4bcd4f

Browse files
tj-mcmikehardy
andauthored
docs(app-check): use quotes vs backticks in example code (#8573)
* Fix typos in app-check index.md The current JS examples cannot be copied into an editor. Most systems use double or single quotes for imports, not backticks. There was also a missing "const" in one of the examples * style(lint): result of main rebase and `yarn lint:markdown --write` our settings for prettier strongly prefer the single-tick apparently definitely not backticks though... also there appears to have been some issue on main, but this fixes that --------- Co-authored-by: Mike Hardy <[email protected]>
1 parent b778210 commit f4bcd4f

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

docs/app-check/usage/index.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ So AppCheck module initialization is done in two steps in react-native-firebase
174174
To configure the react-native-firebase custom provider, first obtain one, then configure it according to the providers you want to use on each platform.
175175

176176
```javascript
177-
import { ReactNativeFirebaseAppCheckProvider } from `@react-native-firebase/app-check`;
177+
import { ReactNativeFirebaseAppCheckProvider } from '@react-native-firebase/app-check';
178178

179-
rnfbProvider = new ReactNativeFirebaseAppCheckProvider();
179+
const rnfbProvider = new ReactNativeFirebaseAppCheckProvider();
180180
rnfbProvider.configure({
181181
android: {
182182
provider: __DEV__ ? 'debug' : 'playIntegrity',
@@ -198,22 +198,25 @@ rnfbProvider.configure({
198198
Once you have the custom provider configured, install it in app-check using the firebase-js-sdk compatible API, while saving the returned instance for usage:
199199

200200
```javascript
201-
import { getApp } from `@react-native-firebase/app`;
202-
import { initializeAppCheck } from `@react-native-firebase/app-check`;
201+
import { getApp } from '@react-native-firebase/app';
202+
import { initializeAppCheck } from '@react-native-firebase/app-check';
203203

204-
const appCheck = initializeAppCheck(getApp(), { provider: rnfbProvider, isTokenAutoRefreshEnabled: true });
204+
const appCheck = initializeAppCheck(getApp(), {
205+
provider: rnfbProvider,
206+
isTokenAutoRefreshEnabled: true,
207+
});
205208
```
206209

207210
### Verify AppCheck was initialized correctly
208211

209212
After initializing the custom provider, you can verify AppCheck is working by logging a response from the token server:
210213

211214
```javascript
212-
import { getToken } from `@react-native-firebase/app-check`;
215+
import { getToken } from '@react-native-firebase/app-check';
213216

214217
try {
215218
// `appCheckInstance` is the saved return value from initializeAppCheck
216-
const { token } = await appCheckInstance.getToken( true);
219+
const { token } = await appCheckInstance.getToken(true);
217220

218221
if (token.length > 0) {
219222
console.log('AppCheck verification passed');

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ However, you only want to do this for the web platform. For non-web / native app
272272
At some point during your application's bootstrap processes, initialize firebase like this:
273273

274274
```javascript
275-
import { getApp, initializeApp } from "@react-native-firebase/app";
275+
import { getApp, initializeApp } from '@react-native-firebase/app';
276276

277277
// web requires dynamic initialization on web prior to using firebase
278-
if (Platform.OS === "web") {
278+
if (Platform.OS === 'web') {
279279
const firebaseConfig = {
280280
// ... config items pasted from firebase console for your web app here
281281
};

0 commit comments

Comments
 (0)