Skip to content

Docs: mark methods and products that don't work in Node #7276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 26, 2023
2 changes: 1 addition & 1 deletion docs-devsite/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# analytics package
Firebase Analytics
The Firebase Analytics Web SDK. This SDK does not work in a Node.js environment.

## Functions

Expand Down
4 changes: 3 additions & 1 deletion docs-devsite/app-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# app-check package
Firebase App Check
The Firebase App Check Web SDK.

Firebase App Check does not work in a Node.js environment using `ReCaptchaV3Provider` or `ReCaptchaEnterpriseProvider`<!-- -->, but can be used in Node.js if you use `CustomProvider` and write your own attestation method.

## Functions

Expand Down
2 changes: 2 additions & 0 deletions docs-devsite/auth.auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ This will affect the currently saved Auth session and applies this type of persi

This makes it easy for a user signing in to specify whether their session should be remembered or not. It also makes it easier to never persist the Auth state for applications that are shared by other users or have sensitive data.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down
28 changes: 28 additions & 0 deletions docs-devsite/auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ Returns a [UserCredential](./auth.usercredential.md#usercredential_interface) fr

If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an error. If no redirect operation was called, returns `null`<!-- -->.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -497,6 +499,8 @@ If initializeRecaptchaConfig() is not invoked, the auth flow will always start w

Thus, by calling this optional method, you will reduce the latency of future auth flows. Loading the reCAPTCHA config early will also enhance the signal collected by reCAPTCHA.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -694,6 +698,8 @@ Changes the type of persistence on the [Auth](./auth.auth.md#auth_interface) ins

This makes it easy for a user signing in to specify whether their session should be remembered or not. It also makes it easier to never persist the `Auth` state for applications that are shared by other users or have sensitive data.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -877,6 +883,8 @@ This method sends a code via SMS to the given phone number, and returns a [Confi

For abuse prevention, this method also requires a [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface)<!-- -->. This SDK includes a reCAPTCHA-based implementation, [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class)<!-- -->. This function can work on other platforms that do not support the [RecaptchaVerifier](./auth.recaptchaverifier.md#recaptchaverifier_class) (like React Native), but you need to use a third-party [ApplicationVerifier](./auth.applicationverifier.md#applicationverifier_interface) implementation.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -913,6 +921,8 @@ Authenticates a Firebase client using a popup-based OAuth authentication flow.

If succeeds, returns the signed in user along with the provider's credential. If sign in was unsuccessful, returns an error object containing additional information about the error.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -953,6 +963,8 @@ Authenticates a Firebase client using a full-page redirect flow.

To handle the results and errors for this operation, refer to [getRedirectResult()](./auth.md#getredirectresult)<!-- -->. Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using [signInWithRedirect()](./auth.md#signinwithredirect)<!-- -->.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -1204,6 +1216,8 @@ Promise&lt;[UserCredential](./auth.usercredential.md#usercredential_interface)<!

Links the user account with the given phone number.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand All @@ -1228,6 +1242,8 @@ Links the authenticated provider to the user account using a pop-up based OAuth

If the linking is successful, the returned result will contain the user and the provider's credential.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -1264,6 +1280,8 @@ Links the [OAuthProvider](./auth.oauthprovider.md#oauthprovider_class) to the us

To handle the results and errors for this operation, refer to [getRedirectResult()](./auth.md#getredirectresult)<!-- -->. Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using [linkWithRedirect()](./auth.md#linkwithredirect)<!-- -->.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -1349,6 +1367,8 @@ Re-authenticates a user using a fresh phone credential.

Use before operations such as [updatePassword()](./auth.md#updatepassword) that require tokens from recent sign-in attempts.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand All @@ -1373,6 +1393,8 @@ Reauthenticates the current user with the specified [OAuthProvider](./auth.oauth

If the reauthentication is successful, the returned result will contain the user and the provider's credential.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -1409,6 +1431,8 @@ Reauthenticates the current user with the specified [OAuthProvider](./auth.oauth

To handle the results and errors for this operation, refer to [getRedirectResult()](./auth.md#getredirectresult)<!-- -->. Follow the [best practices](https://firebase.google.com/docs/auth/web/redirect-best-practices) when using [reauthenticateWithRedirect()](./auth.md#reauthenticatewithredirect)<!-- -->.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -1585,6 +1609,8 @@ Promise&lt;void&gt;

Updates the user's phone number.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down Expand Up @@ -1855,6 +1881,8 @@ browserLocalPersistence: Persistence

An implementation of [PopupRedirectResolver](./auth.popupredirectresolver.md#popupredirectresolver_interface) suitable for browser based applications.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs-devsite/auth.phoneauthprovider.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ https://github.com/firebase/firebase-js-sdk
# PhoneAuthProvider class
Provider for generating an [PhoneAuthCredential](./auth.phoneauthcredential.md#phoneauthcredential_class)<!-- -->.

`PhoneAuthProvider` does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs-devsite/auth.phonemultifactorgenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ static FACTOR_ID: string;

Provides a [PhoneMultiFactorAssertion](./auth.phonemultifactorassertion.md#phonemultifactorassertion_interface) to confirm ownership of the phone second factor.

This method does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down
2 changes: 2 additions & 0 deletions docs-devsite/auth.recaptchaverifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ https://github.com/firebase/firebase-js-sdk
# RecaptchaVerifier class
An [reCAPTCHA](https://www.google.com/recaptcha/)<!-- -->-based application verifier.

`RecaptchaVerifier` does not work in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down
8 changes: 6 additions & 2 deletions docs-devsite/firestore_.firestoresettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export declare interface FirestoreSettings
| Property | Type | Description |
| --- | --- | --- |
| [cacheSizeBytes](./firestore_.firestoresettings.md#firestoresettingscachesizebytes) | number | NOTE: This field will be deprecated in a future major release. Use <code>cache</code> field instead to specify cache size, and other cache configurations.<!-- -->An approximate cache size threshold for the on-disk data. If the cache grows beyond this size, Firestore will start removing data that hasn't been recently used. The size is not a guarantee that the cache will stay below that size, only that if the cache exceeds the given size, cleanup will be attempted.<!-- -->The default value is 40 MB. The threshold must be set to at least 1 MB, and can be set to <code>CACHE_SIZE_UNLIMITED</code> to disable garbage collection. |
| [experimentalAutoDetectLongPolling](./firestore_.firestoresettings.md#firestoresettingsexperimentalautodetectlongpolling) | boolean | Configures the SDK's underlying transport (WebChannel) to automatically detect if long-polling should be used. This is very similar to <code>experimentalForceLongPolling</code>, but only uses long-polling if required.<!-- -->After having had a default value of <code>false</code> since its inception in 2019, the default value of this setting was changed in mid-2023 to <code>true</code>. That is, auto-detection of long polling is now enabled by default. To disable it, set this setting to <code>false</code>, and please open a GitHub issue to share the problems that motivated you disabling long-polling auto-detection. |
| [experimentalForceLongPolling](./firestore_.firestoresettings.md#firestoresettingsexperimentalforcelongpolling) | boolean | Forces the SDK’s underlying network transport (WebChannel) to use long-polling. Each response from the backend will be closed immediately after the backend sends data (by default responses are kept open in case the backend has more data to send). This avoids incompatibility issues with certain proxies, antivirus software, etc. that incorrectly buffer traffic indefinitely. Use of this option will cause some performance degradation though.<!-- -->This setting cannot be used with <code>experimentalAutoDetectLongPolling</code> and may be removed in a future release. If you find yourself using it to work around a specific network reliability issue, please tell us about it in https://github.com/firebase/firebase-js-sdk/issues/1674. |
| [experimentalAutoDetectLongPolling](./firestore_.firestoresettings.md#firestoresettingsexperimentalautodetectlongpolling) | boolean | Configures the SDK's underlying transport (WebChannel) to automatically detect if long-polling should be used. This is very similar to <code>experimentalForceLongPolling</code>, but only uses long-polling if required.<!-- -->After having had a default value of <code>false</code> since its inception in 2019, the default value of this setting was changed in mid-2023 to <code>true</code>. That is, auto-detection of long polling is now enabled by default. To disable it, set this setting to <code>false</code>, and please open a GitHub issue to share the problems that motivated you disabling long-polling auto-detection.<!-- -->This setting cannot be used in a Node.js environment. |
| [experimentalForceLongPolling](./firestore_.firestoresettings.md#firestoresettingsexperimentalforcelongpolling) | boolean | Forces the SDK’s underlying network transport (WebChannel) to use long-polling. Each response from the backend will be closed immediately after the backend sends data (by default responses are kept open in case the backend has more data to send). This avoids incompatibility issues with certain proxies, antivirus software, etc. that incorrectly buffer traffic indefinitely. Use of this option will cause some performance degradation though.<!-- -->This setting cannot be used with <code>experimentalAutoDetectLongPolling</code> and may be removed in a future release. If you find yourself using it to work around a specific network reliability issue, please tell us about it in https://github.com/firebase/firebase-js-sdk/issues/1674.<!-- -->This setting cannot be used in a Node.js environment. |
| [experimentalLongPollingOptions](./firestore_.firestoresettings.md#firestoresettingsexperimentallongpollingoptions) | [ExperimentalLongPollingOptions](./firestore_.experimentallongpollingoptions.md#experimentallongpollingoptions_interface) | Options that configure the SDK’s underlying network transport (WebChannel) when long-polling is used.<!-- -->These options are only used if <code>experimentalForceLongPolling</code> is true or if <code>experimentalAutoDetectLongPolling</code> is true and the auto-detection determined that long-polling was needed. Otherwise, these options have no effect. |
| [host](./firestore_.firestoresettings.md#firestoresettingshost) | string | The hostname to connect to. |
| [ignoreUndefinedProperties](./firestore_.firestoresettings.md#firestoresettingsignoreundefinedproperties) | boolean | Whether to skip nested properties that are set to <code>undefined</code> during object serialization. If set to <code>true</code>, these properties are skipped and not written to Firestore. If set to <code>false</code> or omitted, the SDK throws an exception when it encounters properties of type <code>undefined</code>. |
Expand All @@ -51,6 +51,8 @@ Configures the SDK's underlying transport (WebChannel) to automatically detect i

After having had a default value of `false` since its inception in 2019, the default value of this setting was changed in mid-2023 to `true`<!-- -->. That is, auto-detection of long polling is now enabled by default. To disable it, set this setting to `false`<!-- -->, and please open a GitHub issue to share the problems that motivated you disabling long-polling auto-detection.

This setting cannot be used in a Node.js environment.

<b>Signature:</b>

```typescript
Expand All @@ -63,6 +65,8 @@ Forces the SDK’s underlying network transport (WebChannel) to use long-polling

This setting cannot be used with `experimentalAutoDetectLongPolling` and may be removed in a future release. If you find yourself using it to work around a specific network reliability issue, please tell us about it in https://github.com/firebase/firebase-js-sdk/issues/1674.

This setting cannot be used in a Node.js environment.

<b>Signature:</b>

```typescript
Expand Down
12 changes: 6 additions & 6 deletions docs-devsite/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ https://github.com/firebase/firebase-js-sdk

| Package | Description |
| --- | --- |
| [@firebase/analytics](./analytics.md#analytics_package) | Firebase Analytics |
| [@firebase/analytics](./analytics.md#analytics_package) | The Firebase Analytics Web SDK. This SDK does not work in a Node.js environment. |
| [@firebase/app](./app.md#app_package) | Firebase App |
| [@firebase/app-check](./app-check.md#app-check_package) | Firebase App Check |
| [@firebase/app-check](./app-check.md#app-check_package) | The Firebase App Check Web SDK. |
| [@firebase/auth](./auth.md#auth_package) | Firebase Authentication |
| [@firebase/database](./database.md#database_package) | Firebase Realtime Database |
| [@firebase/firestore](./firestore.md#firestore_package) | Cloud Firestore |
| [@firebase/functions](./functions.md#functions_package) | Cloud Functions for Firebase |
| [@firebase/installations](./installations.md#installations_package) | Firebase Installations |
| [@firebase/messaging](./messaging.md#messaging_package) | Firebase Cloud Messaging |
| [@firebase/performance](./performance.md#performance_package) | Firebase Performance Monitoring |
| [@firebase/remote-config](./remote-config.md#remote-config_package) | Firebase Remote Config |
| [@firebase/installations](./installations.md#installations_package) | The Firebase Installations Web SDK. This SDK does not work in a Node.js environment. |
| [@firebase/messaging](./messaging.md#messaging_package) | The Firebase Cloud Messaging Web SDK. This SDK does not work in a Node.js environment. |
| [@firebase/performance](./performance.md#performance_package) | The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment. |
| [@firebase/remote-config](./remote-config.md#remote-config_package) | The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment. |
| [@firebase/storage](./storage.md#storage_package) | Cloud Storage for Firebase |

2 changes: 1 addition & 1 deletion docs-devsite/installations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# installations package
Firebase Installations
The Firebase Installations Web SDK. This SDK does not work in a Node.js environment.

## Functions

Expand Down
2 changes: 1 addition & 1 deletion docs-devsite/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# messaging package
Firebase Cloud Messaging
The Firebase Cloud Messaging Web SDK. This SDK does not work in a Node.js environment.

| Entry Point | Description |
| --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs-devsite/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# performance package
Firebase Performance Monitoring
The Firebase Performance Monitoring Web SDK. This SDK does not work in a Node.js environment.

## Functions

Expand Down
2 changes: 1 addition & 1 deletion docs-devsite/remote-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://github.com/firebase/firebase-js-sdk
{% endcomment %}

# remote-config package
Firebase Remote Config
The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environment.

## Functions

Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
"test:setup": "node tools/config.js",
"test:saucelabs": "node scripts/run_saucelabs.js",
"docgen": "ts-node-script scripts/docgen/docgen.ts",
"docgen:compat": "yarn docgen:compat:js; yarn docgen:compat:node",
"docgen:compat:js": "node scripts/docgen-compat/generate-docs.js --api js",
"docgen:compat:node": "node scripts/docgen-compat/generate-docs.js --api node",
"docgen:compat": "node scripts/docgen-compat/generate-docs.js --api js",
"lint": "lerna run --scope @firebase/* lint",
"lint:fix": "lerna run --scope @firebase/* lint:fix",
"size-report": "ts-node-script scripts/size_report/report_binary_size.ts",
Expand Down
3 changes: 2 additions & 1 deletion packages/analytics/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Firebase Analytics
* The Firebase Analytics Web SDK.
* This SDK does not work in a Node.js environment.
*
* @packageDocumentation
*/
Expand Down
7 changes: 6 additions & 1 deletion packages/app-check/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/**
* Firebase App Check
* The Firebase App Check Web SDK.
*
* @remarks
* Firebase App Check does not work in a Node.js environment using `ReCaptchaV3Provider` or
* `ReCaptchaEnterpriseProvider`, but can be used in Node.js if you use
* `CustomProvider` and write your own attestation method.
*
* @packageDocumentation
*/
Expand Down
4 changes: 4 additions & 0 deletions packages/auth/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export {
* remembered or not. It also makes it easier to never persist the `Auth` state for applications
* that are shared by other users or have sensitive data.
*
* This method does not work in a Node.js environment.
*
* @example
* ```javascript
* setPersistence(auth, browserSessionPersistence);
Expand Down Expand Up @@ -78,6 +80,8 @@ export function setPersistence(
* Thus, by calling this optional method, you will reduce the latency of future auth flows.
* Loading the reCAPTCHA config early will also enhance the signal collected by reCAPTCHA.
*
* This method does not work in a Node.js environment.
*
* @example
* ```javascript
* initializeRecaptchaConfig(auth);
Expand Down
2 changes: 2 additions & 0 deletions packages/auth/src/model/public_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ export interface Auth {
* remembered or not. It also makes it easier to never persist the Auth state for applications
* that are shared by other users or have sensitive data.
*
* This method does not work in a Node.js environment.
*
* @example
* ```javascript
* auth.setPersistence(browserSessionPersistence);
Expand Down
3 changes: 3 additions & 0 deletions packages/auth/src/platform_browser/mfa/assertions/phone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ export class PhoneMultiFactorGenerator {
/**
* Provides a {@link PhoneMultiFactorAssertion} to confirm ownership of the phone second factor.
*
* @remarks
* This method does not work in a Node.js environment.
*
* @param phoneAuthCredential - A credential provided by {@link PhoneAuthProvider.credential}.
* @returns A {@link PhoneMultiFactorAssertion} which can be used with
* {@link MultiFactorResolver.resolveSignIn}
Expand Down
3 changes: 3 additions & 0 deletions packages/auth/src/platform_browser/popup_redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ class BrowserPopupRedirectResolver implements PopupRedirectResolverInternal {
* An implementation of {@link PopupRedirectResolver} suitable for browser
* based applications.
*
* @remarks
* This method does not work in a Node.js environment.
*
* @public
*/
export const browserPopupRedirectResolver: PopupRedirectResolver =
Expand Down
3 changes: 3 additions & 0 deletions packages/auth/src/platform_browser/providers/phone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import { ProviderId, SignInMethod } from '../../model/enums';
/**
* Provider for generating an {@link PhoneAuthCredential}.
*
* @remarks
* `PhoneAuthProvider` does not work in a Node.js environment.
*
* @example
* ```javascript
* // 'recaptcha-container' is the ID of an element in the DOM.
Expand Down
Loading