Skip to content

Commit a9ba7ba

Browse files
authored
Add documentation for @firebase/auth-exp (#3952)
* Add documentation for @firebase/auth-exp * PR Feedback * Update examples to account for change in API related to credentialFromResult * Rebase conflicts
1 parent 519d2cf commit a9ba7ba

File tree

277 files changed

+3876
-1380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

277 files changed

+3876
-1380
lines changed

common/api-review/auth-exp.api.md

+302-129
Large diffs are not rendered by default.

common/api-review/auth-types-exp.api.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export abstract class AuthCredential {
9797
toJSON(): object;
9898
}
9999

100-
// @public (undocumented)
100+
// @public
101101
export interface AuthError extends FirebaseError {
102102
readonly appName: string;
103103
readonly email?: string;
@@ -247,7 +247,10 @@ export interface Persistence {
247247

248248
// @public
249249
export abstract class PhoneAuthCredential extends AuthCredential {
250+
// (undocumented)
250251
static fromJSON(json: object | string): PhoneAuthCredential | null;
252+
// (undocumented)
253+
toJSON(): object;
251254
}
252255

253256
// @public

docs-exp/auth-types.actioncodeinfo.data.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44

55
## ActionCodeInfo.data property
66

7-
The data associated with the action code. For the [Operation.PASSWORD\_RESET](./auth-types.operation.password_reset.md)<!-- -->, [Operation.VERIFY\_EMAIL](./auth-types.operation.verify_email.md)<!-- -->, and [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) actions, this object contains an email field with the address the email was sent to.
8-
9-
For the [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) action, which allows a user to undo an email address change, this object also contains a `previousEmail` field with the user account's current email address. After the action completes, the user's email address will revert to the value in the `email` field from the value in `previousEmail` field.
10-
11-
For the [Operation.VERIFY\_AND\_CHANGE\_EMAIL](./auth-types.operation.verify_and_change_email.md) action, which allows a user to verify the email before updating it, this object contains a `previousEmail` field with the user account's email address before updating. After the action completes, the user's email address will be updated to the value in the `email` field from the value in `previousEmail` field.
12-
13-
For the [Operation.REVERT\_SECOND\_FACTOR\_ADDITION](./auth-types.operation.revert_second_factor_addition.md) action, which allows a user to unenroll a newly added second factor, this object contains a `multiFactorInfo` field with the information about the second factor. For phone second factor, the `multiFactorInfo` is a [MultiFactorInfo](./auth-types.multifactorinfo.md) object, which contains the phone number.
7+
The data associated with the action code.
148

159
<b>Signature:</b>
1610

@@ -21,3 +15,14 @@ data: {
2115
previousEmail?: string | null;
2216
};
2317
```
18+
19+
## Remarks
20+
21+
For the [Operation.PASSWORD\_RESET](./auth-types.operation.password_reset.md)<!-- -->, [Operation.VERIFY\_EMAIL](./auth-types.operation.verify_email.md)<!-- -->, and [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) actions, this object contains an email field with the address the email was sent to.
22+
23+
For the [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) action, which allows a user to undo an email address change, this object also contains a `previousEmail` field with the user account's current email address. After the action completes, the user's email address will revert to the value in the `email` field from the value in `previousEmail` field.
24+
25+
For the [Operation.VERIFY\_AND\_CHANGE\_EMAIL](./auth-types.operation.verify_and_change_email.md) action, which allows a user to verify the email before updating it, this object contains a `previousEmail` field with the user account's email address before updating. After the action completes, the user's email address will be updated to the value in the `email` field from the value in `previousEmail` field.
26+
27+
For the [Operation.REVERT\_SECOND\_FACTOR\_ADDITION](./auth-types.operation.revert_second_factor_addition.md) action, which allows a user to unenroll a newly added second factor, this object contains a `multiFactorInfo` field with the information about the second factor. For phone second factor, the `multiFactorInfo` is a [MultiFactorInfo](./auth-types.multifactorinfo.md) object, which contains the phone number.
28+

docs-exp/auth-types.actioncodeinfo.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## ActionCodeInfo interface
66

7-
A response from `checkActionCode`<!-- -->.
7+
A response from [checkActionCode()](./auth.checkactioncode.md)<!-- -->.
88

99
<b>Signature:</b>
1010

@@ -16,6 +16,6 @@ export interface ActionCodeInfo
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19-
| [data](./auth-types.actioncodeinfo.data.md) | { email?: string \| null; multiFactorInfo?: [MultiFactorInfo](./auth-types.multifactorinfo.md) \| null; previousEmail?: string \| null; } | The data associated with the action code. For the [Operation.PASSWORD\_RESET](./auth-types.operation.password_reset.md)<!-- -->, [Operation.VERIFY\_EMAIL](./auth-types.operation.verify_email.md)<!-- -->, and [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) actions, this object contains an email field with the address the email was sent to.<!-- -->For the [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) action, which allows a user to undo an email address change, this object also contains a <code>previousEmail</code> field with the user account's current email address. After the action completes, the user's email address will revert to the value in the <code>email</code> field from the value in <code>previousEmail</code> field.<!-- -->For the [Operation.VERIFY\_AND\_CHANGE\_EMAIL](./auth-types.operation.verify_and_change_email.md) action, which allows a user to verify the email before updating it, this object contains a <code>previousEmail</code> field with the user account's email address before updating. After the action completes, the user's email address will be updated to the value in the <code>email</code> field from the value in <code>previousEmail</code> field.<!-- -->For the [Operation.REVERT\_SECOND\_FACTOR\_ADDITION](./auth-types.operation.revert_second_factor_addition.md) action, which allows a user to unenroll a newly added second factor, this object contains a <code>multiFactorInfo</code> field with the information about the second factor. For phone second factor, the <code>multiFactorInfo</code> is a [MultiFactorInfo](./auth-types.multifactorinfo.md) object, which contains the phone number. |
19+
| [data](./auth-types.actioncodeinfo.data.md) | { email?: string \| null; multiFactorInfo?: [MultiFactorInfo](./auth-types.multifactorinfo.md) \| null; previousEmail?: string \| null; } | The data associated with the action code. |
2020
| [operation](./auth-types.actioncodeinfo.operation.md) | [Operation](./auth-types.operation.md) | The type of operation that generated the action code. |
2121

docs-exp/auth-types.actioncodesettings.android.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## ActionCodeSettings.android property
66

7-
Sets the Android package name. This will try to open the link in an android app if it is installed. If `installApp` is passed, it specifies whether to install the Android app if the device supports it and the app is not already installed. If this field is provided without a `packageName`<!-- -->, an error is thrown explaining that the `packageName` must be provided in conjunction with this field. If `minimumVersion` is specified, and an older version of the app is installed, the user is taken to the Play Store to upgrade the app.
7+
Sets the Android package name.
88

99
<b>Signature:</b>
1010

@@ -15,3 +15,8 @@ android?: {
1515
packageName: string;
1616
};
1717
```
18+
19+
## Remarks
20+
21+
This will try to open the link in an android app if it is installed. If `installApp` is passed, it specifies whether to install the Android app if the device supports it and the app is not already installed. If this field is provided without a `packageName`<!-- -->, an error is thrown explaining that the `packageName` must be provided in conjunction with this field. If `minimumVersion` is specified, and an older version of the app is installed, the user is taken to the Play Store to upgrade the app.
22+

docs-exp/auth-types.actioncodesettings.dynamiclinkdomain.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## ActionCodeSettings.dynamicLinkDomain property
66

7-
When multiple custom dynamic link domains are defined for a project, specify which one to use when the link is to be opened via a specified mobile app (for example, `example.page.link`<!-- -->). Otherwise the first domain is automatically selected.
7+
When multiple custom dynamic link domains are defined for a project, specify which one to use when the link is to be opened via a specified mobile app (for example, `example.page.link`<!-- -->).
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.actioncodesettings.handlecodeinapp.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44

55
## ActionCodeSettings.handleCodeInApp property
66

7-
The default is false. When set to true, the action code link will be be sent as a Universal Link or Android App Link and will be opened by the app if installed. In the false case, the code will be sent to the web widget first and then on continue will redirect to the app if installed.
7+
When set to true, the action code link will be be sent as a Universal Link or Android App Link and will be opened by the app if installed.
88

99
<b>Signature:</b>
1010

1111
```typescript
1212
handleCodeInApp?: boolean;
1313
```
14+
15+
## Remarks
16+
17+
In the false case, the code will be sent to the web widget first and then on continue will redirect to the app if installed.
18+

docs-exp/auth-types.actioncodesettings.ios.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44

55
## ActionCodeSettings.iOS property
66

7-
Sets the iOS bundle ID. This will try to open the link in an iOS app if it is installed.
8-
9-
App installation is not supported for iOS.
7+
Sets the iOS bundle ID.
108

119
<b>Signature:</b>
1210

@@ -15,3 +13,10 @@ iOS?: {
1513
bundleId: string;
1614
};
1715
```
16+
17+
## Remarks
18+
19+
This will try to open the link in an iOS app if it is installed.
20+
21+
App installation is not supported for iOS.
22+

docs-exp/auth-types.actioncodesettings.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## ActionCodeSettings interface
66

7-
This is the interface that defines the required continue/state URL with optional Android and iOS bundle identifiers.
7+
An interface that defines the required continue/state URL with optional Android and iOS bundle identifiers.
88

99
<b>Signature:</b>
1010

@@ -16,9 +16,9 @@ export interface ActionCodeSettings
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19-
| [android](./auth-types.actioncodesettings.android.md) | { installApp?: boolean; minimumVersion?: string; packageName: string; } | Sets the Android package name. This will try to open the link in an android app if it is installed. If <code>installApp</code> is passed, it specifies whether to install the Android app if the device supports it and the app is not already installed. If this field is provided without a <code>packageName</code>, an error is thrown explaining that the <code>packageName</code> must be provided in conjunction with this field. If <code>minimumVersion</code> is specified, and an older version of the app is installed, the user is taken to the Play Store to upgrade the app. |
20-
| [dynamicLinkDomain](./auth-types.actioncodesettings.dynamiclinkdomain.md) | string | When multiple custom dynamic link domains are defined for a project, specify which one to use when the link is to be opened via a specified mobile app (for example, <code>example.page.link</code>). Otherwise the first domain is automatically selected. |
21-
| [handleCodeInApp](./auth-types.actioncodesettings.handlecodeinapp.md) | boolean | The default is false. When set to true, the action code link will be be sent as a Universal Link or Android App Link and will be opened by the app if installed. In the false case, the code will be sent to the web widget first and then on continue will redirect to the app if installed. |
22-
| [iOS](./auth-types.actioncodesettings.ios.md) | { bundleId: string; } | Sets the iOS bundle ID. This will try to open the link in an iOS app if it is installed.<!-- -->App installation is not supported for iOS. |
23-
| [url](./auth-types.actioncodesettings.url.md) | string | Sets the link continue/state URL, which has different meanings in different contexts: - When the link is handled in the web action widgets, this is the deep link in the <code>continueUrl</code> query parameter. - When the link is handled in the app directly, this is the <code>continueUrl</code> query parameter in the deep link of the Dynamic Link. |
19+
| [android](./auth-types.actioncodesettings.android.md) | { installApp?: boolean; minimumVersion?: string; packageName: string; } | Sets the Android package name. |
20+
| [dynamicLinkDomain](./auth-types.actioncodesettings.dynamiclinkdomain.md) | string | When multiple custom dynamic link domains are defined for a project, specify which one to use when the link is to be opened via a specified mobile app (for example, <code>example.page.link</code>). |
21+
| [handleCodeInApp](./auth-types.actioncodesettings.handlecodeinapp.md) | boolean | When set to true, the action code link will be be sent as a Universal Link or Android App Link and will be opened by the app if installed. |
22+
| [iOS](./auth-types.actioncodesettings.ios.md) | { bundleId: string; } | Sets the iOS bundle ID. |
23+
| [url](./auth-types.actioncodesettings.url.md) | string | Sets the link continue/state URL. |
2424

docs-exp/auth-types.actioncodesettings.url.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44

55
## ActionCodeSettings.url property
66

7-
Sets the link continue/state URL, which has different meanings in different contexts: - When the link is handled in the web action widgets, this is the deep link in the `continueUrl` query parameter. - When the link is handled in the app directly, this is the `continueUrl` query parameter in the deep link of the Dynamic Link.
7+
Sets the link continue/state URL.
88

99
<b>Signature:</b>
1010

1111
```typescript
1212
url: string;
1313
```
14+
15+
## Remarks
16+
17+
This has different meanings in different contexts: - When the link is handled in the web action widgets, this is the deep link in the `continueUrl` query parameter. - When the link is handled in the app directly, this is the `continueUrl` query parameter in the deep link of the Dynamic Link.
18+

docs-exp/auth-types.actioncodeurl.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ export abstract class ActionCodeURL
2727

2828
| Method | Modifiers | Description |
2929
| --- | --- | --- |
30-
| [parseLink(link)](./auth-types.actioncodeurl.parselink.md) | <code>static</code> | Parses the email action link string and returns an ActionCodeURL object if the link is valid, otherwise returns null. |
30+
| [parseLink(link)](./auth-types.actioncodeurl.parselink.md) | <code>static</code> | Parses the email action link string and returns an [ActionCodeURL](./auth-types.actioncodeurl.md) if the link is valid, otherwise returns null. |
3131

docs-exp/auth-types.actioncodeurl.parselink.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## ActionCodeURL.parseLink() method
66

7-
Parses the email action link string and returns an ActionCodeURL object if the link is valid, otherwise returns null.
7+
Parses the email action link string and returns an [ActionCodeURL](./auth-types.actioncodeurl.md) if the link is valid, otherwise returns null.
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.applicationverifier.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44

55
## ApplicationVerifier interface
66

7-
A verifier for domain verification and abuse prevention. Currently, the only implementation is [RecaptchaVerifier](./auth-types.recaptchaverifier.md)<!-- -->.
7+
A verifier for domain verification and abuse prevention.
88

99
<b>Signature:</b>
1010

1111
```typescript
1212
export interface ApplicationVerifier
1313
```
1414

15+
## Remarks
16+
17+
Currently, the only implementation is [RecaptchaVerifier](./auth.recaptchaverifier.md)<!-- -->.
18+
1519
## Properties
1620

1721
| Property | Type | Description |

docs-exp/auth-types.auth.languagecode.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44

55
## Auth.languageCode property
66

7-
The Auth instance's language code. This is a readable/writable property. When set to null, the default Firebase Console language setting is applied. The language code will propagate to email action templates (password reset, email verification and email change revocation), SMS templates for phone authentication, reCAPTCHA verifier and OAuth popup/redirect operations provided the specified providers support localization with the language code specified.
7+
The Auth instance's language code.
88

99
<b>Signature:</b>
1010

1111
```typescript
1212
languageCode: string | null;
1313
```
14+
15+
## Remarks
16+
17+
This is a readable/writable property. When set to null, the default Firebase Console language setting is applied. The language code will propagate to email action templates (password reset, email verification and email change revocation), SMS templates for phone authentication, reCAPTCHA verifier and OAuth popup/redirect operations provided the specified providers support localization with the language code specified.
18+

0 commit comments

Comments
 (0)