Skip to content

Commit 2f17c84

Browse files
authored
Merge pull request #739 from Web3Auth/feat/modular-notes
Mobile doc updates
2 parents 0692128 + 1db640b commit 2f17c84

38 files changed

Lines changed: 516 additions & 457 deletions

docs/sdk/pnp/android/android.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ generated in a non-custodial way on successful user authentication. This authent
1313
achieved by using any social login options that Web3Auth supports or custom authentication flow of
1414
your choice.
1515

16-
#### This Documentation is based on the `7.1.1` SDK Version.
16+
#### This Documentation is based on the `7.3.0` SDK Version.
1717

1818
## Requirements
1919

docs/sdk/pnp/android/custom-authentication.mdx

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,36 @@ description: "Web3Auth PnP Android SDK - Using Custom Authentication | Documenta
77

88
import TabItem from "@theme/TabItem";
99
import Tabs from "@theme/Tabs";
10+
import GrowthPlanNote from "@site/src/common/docs/_growth_plan_note.mdx";
1011

11-
To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you
12-
can add the configuration to the `loginConfig` parameter of the `Web3AuthOptions` object during the initialization.
12+
To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito,
13+
Firebase etc. or even your own custom JWT login) you can add the configuration to the `loginConfig`
14+
parameter of the `Web3AuthOptions` object during the initialization.
1315

14-
The `loginConfig` parameter is a key value map. The key should be one of the `Web3AuthProvider` in its string form, and the value should be a
15-
`LoginConfigItem` instance.
16+
The `loginConfig` parameter is a key value map. The key should be one of the `Web3AuthProvider` in
17+
its string form, and the value should be a `LoginConfigItem` instance.
1618

1719
First, configure your own verifier in the Web3Auth Dashboard to use custom authentication.
1820

19-
:::note
20-
21-
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this SDK in a production environment is the **Growth
22-
Plan**. You can use this feature in the development environment for free.
23-
24-
:::
21+
<GrowthPlanNote />
2522

2623
:::tip Create Custom Verifier
2724

28-
Check out how to create a **[Custom Verifier](/auth-provider-setup/verifiers)** on the Web3Auth Dashboard.
25+
Check out how to create a **[Custom Verifier](/auth-provider-setup/verifiers)** on the Web3Auth
26+
Dashboard.
2927

3028
:::
3129

3230
:::info using dapp share
3331

3432
- dApp Share is only returned for the Custom verifiers.
35-
- Also, 2FA should be enabled for the account using it. Use `mfaLevel = MFALevel.MANDATORY` in the `LoginParams` during login. See
36-
**[MFA](/sdk/pnp/android/mfa)** for more details.
33+
- Also, 2FA should be enabled for the account using it. Use `mfaLevel = MFALevel.MANDATORY` in the
34+
`LoginParams` during login. See **[MFA](/sdk/pnp/android/mfa)** for more details.
3735

3836
:::
3937

40-
Then, you should specify the details of your verifier in the `LoginConfigItem` struct, the details of this struct are as follows:
38+
Then, you should specify the details of your verifier in the `LoginConfigItem` struct, the details
39+
of this struct are as follows:
4140

4241
## `LoginConfigItem`
4342

@@ -241,8 +240,9 @@ web3Auth = Web3Auth (
241240

242241
## `ExtraLoginOptions` for special login methods
243242

244-
Additional to the `LoginConfig` you can pass extra options to the `login` function to configure the login flow for cases requiring additional info for
245-
enabling login. The `ExtraLoginOptions` accepts the following parameters:
243+
Additional to the `LoginConfig` you can pass extra options to the `login` function to configure the
244+
login flow for cases requiring additional info for enabling login. The `ExtraLoginOptions` accepts
245+
the following parameters:
246246

247247
<Tabs
248248
defaultValue="table"
@@ -314,8 +314,9 @@ data class ExtraLoginOptions(
314314

315315
### Using Auth0 Login
316316

317-
Auth0 has a special login flow, called the SPA flow. This flow requires a `client_id` and `domain` to be passed, and Web3Auth will get the JWT
318-
`id_token` from Auth0 directly. You can pass these configurations in the `ExtraLoginOptions` object in the login function.
317+
Auth0 has a special login flow, called the SPA flow. This flow requires a `client_id` and `domain`
318+
to be passed, and Web3Auth will get the JWT `id_token` from Auth0 directly. You can pass these
319+
configurations in the `ExtraLoginOptions` object in the login function.
319320

320321
```tsx
321322
web3Auth = Web3Auth (
@@ -348,9 +349,10 @@ val loginCompletableFuture: CompletableFuture<Web3AuthResponse> =
348349

349350
### Custom JWT Login
350351

351-
If you're using any other provider like Firebase/ AWS Cognito or deploying your own Custom JWT server, you need to put the jwt token into the
352-
`id_token` field of the `extraLoginOptions`, additionally, you need to pass over the `domain` field as well, which is mandatory. If you don't have a
353-
domain, just passover a string in that field.
352+
If you're using any other provider like Firebase/ AWS Cognito or deploying your own Custom JWT
353+
server, you need to put the jwt token into the `id_token` field of the `extraLoginOptions`,
354+
additionally, you need to pass over the `domain` field as well, which is mandatory. If you don't
355+
have a domain, just passover a string in that field.
354356

355357
```tsx
356358
web3Auth = Web3Auth (
@@ -381,7 +383,8 @@ val loginCompletableFuture: CompletableFuture<Web3AuthResponse> =
381383

382384
### Email Passwordless
383385

384-
To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` field of the `extraLoginOptions`.
386+
To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` field of the
387+
`extraLoginOptions`.
385388

386389
```kotlin
387390
val loginCompletableFuture: CompletableFuture<Web3AuthResponse> = web3Auth.login(

docs/sdk/pnp/android/install.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Installation from "@site/src/common/sdk/pnp/android/_installation.mdx";
1010
import AndroidPermissions from "@site/src/common/sdk/pnp/android/_android-permissions.mdx";
1111
import Whitelist from "@site/src/common/sdk/pnp/android/_android-whitelist.mdx";
1212
import Deeplinking from "@site/src/common/sdk/pnp/android/_android-deep-linking.mdx";
13+
import ManifestChanges from "@site/src/common/sdk/pnp/android/_android-manifest-changes.mdx";
1314

1415
## Add Web3Auth to Gradle
1516

@@ -29,6 +30,10 @@ Then, in your app-level `build.gradle` dependencies section, add the following:
2930

3031
<Whitelist />
3132

33+
### Configure AndroidManifest File
34+
35+
<ManifestChanges />
36+
3237
### Configure Deep Link
3338

3439
<Deeplinking />

docs/sdk/pnp/android/mfa.mdx

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,40 @@ description: "Web3Auth PnP Android SDK - Multi Factor Authentication | Documenta
77

88
import TabItem from "@theme/TabItem";
99
import Tabs from "@theme/Tabs";
10-
11-
At Web3Auth, we prioritize your security by offering Multi-Factor Authentication (MFA). MFA is an extra layer of protection that verifies your
12-
identity when accessing your account. To ensure ownership, you must provide two or more different backup factors. You have the option to choose from
13-
the device, social, backup factor (seed phrase), and password factors to guarantee access to your Web3 account. Once you create a recovery factor, MFA
14-
is enabled, and your keys are divided into three shares for off-chain multi-sig, making the key self-custodial. With backup factors, you can easily
15-
recover your account if you lose access to your original device or helps login into a new device.
16-
17-
You can set the mfaLevel within the `loginParams` to customize when mfa screen should be shown to user. It currently accepts 4 values:
18-
19-
- **`default`** - Setting the mfaLevel to default will present the MFA screen to user on every third login. `mfaLevel = MFALevel.DEFAULT`
20-
- **`optional`** - Setting mfaLevel to optional will present the MFA screen to user on every login but user will have the option to skip it.
21-
`mfaLevel = MFALevel.OPTIONAL`
22-
- **`mandatory`** - Setting mfaLevel to mandatory will make it mandatory for user to setup MFA after login. `mfaLevel = MFALevel.MANDATORY`
23-
- **`none`** - Setting mfaLevel to none will skip the mfa setup screen totally. `mfaLevel = MFALevel.NONE`
10+
import MFAMinimumPlan from "@site/src/common/docs/_mfa_minimum_plan.mdx";
11+
12+
At Web3Auth, we prioritize your security by offering Multi-Factor Authentication (MFA). MFA is an
13+
extra layer of protection that verifies your identity when accessing your account. To ensure
14+
ownership, you must provide two or more different backup factors. You have the option to choose from
15+
the device, social, backup factor (seed phrase), and password factors to guarantee access to your
16+
Web3 account. Once you create a recovery factor, MFA is enabled, and your keys are divided into
17+
three shares for off-chain multi-sig, making the key self-custodial. With backup factors, you can
18+
easily recover your account if you lose access to your original device or helps login into a new
19+
device.
20+
21+
You can set the mfaLevel within the `loginParams` to customize when mfa screen should be shown to
22+
user. It currently accepts 4 values:
23+
24+
- **`default`** - Setting the mfaLevel to default will present the MFA screen to user on every third
25+
login. `mfaLevel = MFALevel.DEFAULT`
26+
- **`optional`** - Setting mfaLevel to optional will present the MFA screen to user on every login
27+
but user will have the option to skip it. `mfaLevel = MFALevel.OPTIONAL`
28+
- **`mandatory`** - Setting mfaLevel to mandatory will make it mandatory for user to setup MFA after
29+
login. `mfaLevel = MFALevel.MANDATORY`
30+
- **`none`** - Setting mfaLevel to none will skip the mfa setup screen totally.
31+
`mfaLevel = MFALevel.NONE`
2432

2533
To trigger the MFA flow after authentication, you can use `enableMFA` method.
2634

2735
:::caution Note
2836

29-
If you are using default verifiers, your users may have set up MFA on other dApps that also use default Web3Auth verifiers. In this case, the MFA
30-
screen will continue to appear if the user has enabled MFA on other dApps. This is because MFA cannot be turned off once it is enabled.
37+
If you are using default verifiers, your users may have set up MFA on other dApps that also use
38+
default Web3Auth verifiers. In this case, the MFA screen will continue to appear if the user has
39+
enabled MFA on other dApps. This is because MFA cannot be turned off once it is enabled.
3140

3241
:::
3342

34-
:::note Minimum Growth plan required
35-
36-
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this SDK in a production environment is the **Growth
37-
Plan**. You can use this feature in the development environment for free.
38-
39-
:::
43+
<MFAMinimumPlan />
4044

4145
```kotlin
4246
web3Auth.login(LoginParams(selectedLoginProvider, mfaLevel = MFALevel.MANDATORY))
@@ -86,12 +90,14 @@ class MainActivity : AppCompatActivity() {
8690

8791
:::note Minimum SCALE plan required
8892

89-
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this SDK in a production environment is the **SCALE
90-
Plan**. You can use this feature in the development environment for free.
93+
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this
94+
SDK in a production environment is the **SCALE Plan**. You can use this feature in the development
95+
environment for free.
9196

9297
:::
9398

94-
You can configure the order of MFA or enable/disable MFA type by passing the `mfaSettings` object in `Web3AuthOptions`.
99+
You can configure the order of MFA or enable/disable MFA type by passing the `mfaSettings` object in
100+
`Web3AuthOptions`.
95101

96102
`MfaSettings`
97103

docs/sdk/pnp/android/usage.mdx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ class MainActivity : AppCompatActivity() {
526526
## Launch Wallet Services
527527

528528
The `launchWalletServices` method launches a WebView which allows you to use the templated wallet UI
529-
services. The method takes `LoginParams` and `ChainConfig` as the required input.Wallet Services is
530-
currently only available for EVM chains.
529+
services. The method takes`ChainConfig` as the required input. Wallet Services is currently only
530+
available for EVM chains.
531531

532532
:::note Minimum Scale plan required
533533

@@ -585,7 +585,6 @@ data class ChainConfig(
585585
</Tabs>
586586

587587
```kotlin title="Usage"
588-
val loginParams = LoginParams(Provider.GOOGLE)
589588

590589
// highlight-start
591590
val chainConfig = ChainConfig(
@@ -597,7 +596,7 @@ val chainConfig = ChainConfig(
597596
// highlight-end
598597

599598
val completableFuture = web3Auth.launchWalletServices(
600-
loginParams, chainConfig
599+
chainConfig
601600
)
602601

603602
completableFuture.whenComplete{_, error ->
@@ -624,7 +623,7 @@ that the request method currently supports only the signing methods.
624623

625624
| Arguments | Description |
626625
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
627-
| `loginParams` | Takes in `LoginParams` used for authenticating the user. If you are using a custom verifier, please make sure to pass the valid JWT token in `LoginParams`. |
626+
| `chainConifg` | Defines the chain to be used for signature request. |
628627
| `method` | JSON RPC method name in `String`. Currently, the request method only supports the singing methods. |
629628
| `requestParams` | Parameters for the corresponding method. The parameters should be in the list and correct sequence. Take a look at [RPC methods](<[https://docs.metamask.io/wallet/reference/json-rpc-api/](https://docs.metamask.io/wallet/reference/json-rpc-api/)>) to know more. |
630629

@@ -639,10 +638,15 @@ val params = JsonArray().apply {
639638
add(address)
640639
}
641640

642-
val loginParams = LoginParams(Provider.GOOGLE)
641+
val chainConfig = ChainConfig(
642+
chainId = "0x1",
643+
rpcTarget = "https://rpc.ankr.com/eth",
644+
ticker = "ETH",
645+
chainNamespace = ChainNamespace.EIP155
646+
)
643647

644648
val signMsgCompletableFuture = web3Auth.request(
645-
loginParams = loginParams,
649+
chainConfig = chainConfig,
646650
"personal_sign",
647651
requestParams = params
648652
)

docs/sdk/pnp/android/whitelabel.mdx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ description: "Web3Auth PnP Android SDK - Whitelabel | Documentation - Web3Auth"
88
import TabItem from "@theme/TabItem";
99
import Tabs from "@theme/Tabs";
1010
import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx";
11+
import GrowthPlanNote from "@site/src/common/docs/_growth_plan_note.mdx";
1112

12-
For defining custom UI, branding, and translations for your brand, you just need to specify an additional parameter within the `Web3AuthOptions`
13-
object called `whiteLabel`. This parameter takes object called `WhiteLabelData`.
13+
For defining custom UI, branding, and translations for your brand, you just need to specify an
14+
additional parameter within the `Web3AuthOptions` object called `whiteLabel`. This parameter takes
15+
object called `WhiteLabelData`.
1416

15-
:::note
16-
17-
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this SDK in a production environment is the **Growth
18-
Plan**. You can use this feature in the development environment for free.
19-
20-
:::
17+
<GrowthPlanNote />
2118

2219
### Arguments
2320

docs/sdk/pnp/flutter/custom-authentication.mdx

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,34 @@ description: "Web3Auth PnP Flutter SDK - Using Custom Authentication | Documenta
77

88
import TabItem from "@theme/TabItem";
99
import Tabs from "@theme/Tabs";
10+
import GrowthPlanNote from "@site/src/common/docs/_growth_plan_note.mdx";
1011

11-
To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you
12-
can add the configuration to the `loginConfig` parameter of the `LoginParams` object during the initialization.
12+
To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito,
13+
Firebase etc. or even your own custom JWT login) you can add the configuration to the `loginConfig`
14+
parameter of the `LoginParams` object during the initialization.
1315

14-
The `loginConfig` parameter is a key value map. The key should be one of the `TypeOfLogin` in its string form, and the value should be a
15-
`LoginConfigItem` struct.
16+
The `loginConfig` parameter is a key value map. The key should be one of the `TypeOfLogin` in its
17+
string form, and the value should be a `LoginConfigItem` struct.
1618

17-
To use custom authentication, first you'll need to configure your own verifier in the Web3Auth Dashboard in Custom Authentication section.
19+
To use custom authentication, first you'll need to configure your own verifier in the Web3Auth
20+
Dashboard in Custom Authentication section.
1821

1922
:::tip Create Custom Verifier
2023

21-
Check out how to create a **[Custom Verifier](/auth-provider-setup/verifiers)** on the Web3Auth Dashboard.
24+
Check out how to create a **[Custom Verifier](/auth-provider-setup/verifiers)** on the Web3Auth
25+
Dashboard.
2226

2327
:::
2428

2529
:::info using dapp share
2630

2731
- dApp Share is only returned for the Custom verifiers.
28-
- Also, 2FA should be enabled for the account using it. Use `mfaLevel = MFALevel.MANDATORY` in the `LoginParams` during login. See
29-
**[MFA](/sdk/pnp/flutter/mfa)** for more details.
32+
- Also, 2FA should be enabled for the account using it. Use `mfaLevel = MFALevel.MANDATORY` in the
33+
`LoginParams` during login. See **[MFA](/sdk/pnp/flutter/mfa)** for more details.
3034

3135
:::
3236

33-
:::note
34-
35-
This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricing.html) to use this SDK in a production environment is the **Growth
36-
Plan**. You can use this feature in the development environment for free.
37-
38-
:::
37+
<GrowthPlanNote />
3938

4039
Then, specify the details of your verifier in the `LoginConfigItem` struct as follows:
4140

@@ -312,8 +311,9 @@ final Web3AuthResponse response = await Web3AuthFlutter.login(
312311

313312
## `ExtraLoginOptions` for special login methods
314313

315-
Additional to the `LoginConfig` you can pass extra options to the `login` function to configure the login flow for cases requiring additional info for
316-
enabling login. The `ExtraLoginOptions` accepts the following parameters:
314+
Additional to the `LoginConfig` you can pass extra options to the `login` function to configure the
315+
login flow for cases requiring additional info for enabling login. The `ExtraLoginOptions` accepts
316+
the following parameters:
317317

318318
<Tabs
319319
defaultValue="table"
@@ -432,8 +432,9 @@ class ExtraLoginOptions {
432432

433433
### Using Auth0 Login
434434

435-
Auth0 has a special login flow, called the SPA flow. This flow requires a `client_id` and `domain` to be passed, and Web3Auth will get the JWT
436-
`id_token` from Auth0 directly. You can pass these configurations in the `ExtraLoginOptions` object in the `login` function.
435+
Auth0 has a special login flow, called the SPA flow. This flow requires a `client_id` and `domain`
436+
to be passed, and Web3Auth will get the JWT `id_token` from Auth0 directly. You can pass these
437+
configurations in the `ExtraLoginOptions` object in the `login` function.
437438

438439
```dart
439440
Future<void> initWeb3Auth() async {
@@ -487,8 +488,8 @@ final Web3AuthResponse response = await Web3AuthFlutter.login(
487488

488489
### Custom JWT Login
489490

490-
If you're using any other provider like Firebase, AWS Cognito or deploying your own Custom JWT server, you need to put the jwt token into the
491-
`id_token` parameter of the `ExtraLoginOptions`.
491+
If you're using any other provider like Firebase, AWS Cognito or deploying your own Custom JWT
492+
server, you need to put the jwt token into the `id_token` parameter of the `ExtraLoginOptions`.
492493

493494
```dart
494495
Future<void> initWeb3Auth() async {
@@ -540,8 +541,9 @@ final Web3AuthResponse response = await Web3AuthFlutter.login(
540541

541542
### Email Passwordless
542543

543-
To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` parameter of the `ExtraLoginOptions`. By default, the login
544-
flow will be `code` flow, if you want to use the `link` flow, you need to put `flow_type` into the `additionalParams` parameter of the
544+
To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` parameter of
545+
the `ExtraLoginOptions`. By default, the login flow will be `code` flow, if you want to use the
546+
`link` flow, you need to put `flow_type` into the `additionalParams` parameter of the
545547
`ExtraLoginOptions`.
546548

547549
```dart

0 commit comments

Comments
 (0)