From 9669672eec314e47dc2885a36f0a3e6d42a6bc43 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Mon, 11 Mar 2024 20:08:15 +0530 Subject: [PATCH 1/9] update docs for Flutter --- .../sdk/pnp/flutter/custom-authentication.mdx | 74 +++++--- docs/sdk/pnp/flutter/initialize.mdx | 22 +-- docs/sdk/pnp/flutter/mfa.mdx | 27 ++- docs/sdk/pnp/flutter/usage.mdx | 168 ++---------------- docs/sdk/pnp/flutter/whitelabel.mdx | 24 +-- 5 files changed, 97 insertions(+), 218 deletions(-) diff --git a/docs/sdk/pnp/flutter/custom-authentication.mdx b/docs/sdk/pnp/flutter/custom-authentication.mdx index ff117e2c3..fbcc2f8b1 100644 --- a/docs/sdk/pnp/flutter/custom-authentication.mdx +++ b/docs/sdk/pnp/flutter/custom-authentication.mdx @@ -8,8 +8,8 @@ description: "Web3Auth PnP Flutter SDK - Using Custom Authentication | Documenta import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; -To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you can -add the configuration to the `loginConfig` parameter of the `LoginParams` object during the initialization. +To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you +can add the configuration to the `loginConfig` parameter of the `LoginParams` object during the initialization. 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 `LoginConfigItem` struct. @@ -32,8 +32,8 @@ Check out how to create a **[Custom Verifier](/auth-provider-setup/verifiers)** :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -55,21 +55,21 @@ Then, specify the details of your verifier in the `LoginConfigItem` struct as fo -| Parameter | Type | Mandatory | Description | -| --------------------- | ------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `verifier` | `String` | Yes | The name of the verifier that you have registered on the Web3Auth Dashboard. | -| `typeOfLogin` | `TypeOfLogin` | Yes | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. | -| `clientId` | `String` | Yes | The Client Id of the login provider. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. | -| `name` | `String?` | No | Name of your verifier. | -| `description` | `String?` | No | Description of this login flow. | -| `verifierSubIdentifier` | `String?` | No | The name of the field in the JWT that should be used as the unique user ID of the JWT. Should be same as the one you used. | -| `logoHover` | `String?` | No | Logo to be shown on mouse hover. | -| `logoLight` | `String?` | No | Light logo for dark background | -| `logoDark` | `String?` | No | Dark logo for light background | -| `mainOption` | `bool?` | No | Show login button on the main list | -| `showOnModal` | `bool?` | No | Whether to show the login button on modal or not | -| `showOnDesktop` | `bool?` | No | Whether to show the login button on desktop | -| `showOnMobile` | `bool?` | No | Whether to show the login button on mobile | +| Parameter | Description | +| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `String` as a value. | +| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `TypeOfLogin` as a value. | +| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `String` as a value. | +| `name?` | Display name for the verifier. If null, the default name is used. It accepts `String` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `String` as a value. | +| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `String` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `String` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `String` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `String` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `bool` as a value. | +| `showOnModal?` | Whether to show the login button on modal or not. | +| `showOnDesktop?` | Whether to show the login button on desktop. | +| `showOnMobile?` | Whether to show the login button on mobile. | @@ -325,14 +325,29 @@ enabling login. The `ExtraLoginOptions` accepts the following parameters: -| Parameter | Type | Description | -| --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------- | -| `domain` | `string` | Your Auth0 account domain such as `example.auth0.com` or `example.mycompany.com` etc. | -| `client_id` | `string` | The Client ID found on your Auth0 Application settings page. **Use web3auth client id in case of custom JWT login.** | -| `redirect_uri` | `string` | The default URL where Auth0 will redirect your browser to with the authentication result. | -| `leeway` | `number` | The value in seconds used to account for clock skew in JWT expirations. | -| `verifierIdField` | `string` | The field in jwt token which maps to verifier id. | -| `isVerifierIdCaseSensitive` | `boolean` | Whether the verifier id field is case sensitive. Defaults to `true` | +| Parameter | Description | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalParams?` | Additional params in `Map` format for OAuth login, use id_token(JWT) to authenticate with web3auth. | +| `domain?` | Your custom authentication domain in `String` format. For example, if you are using Auth0, it can be example.au.auth0.com. | +| `client_id?` | Client id in `String` format, provided by your login provider used for custom verifier. | +| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `String` as a value. | +| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `String` as a value. | +| `isVerifierIdCaseSensitive?` | Boolean to confirm Whether the verifier id field is case sensitive or not. | +| `display?` | Allows developers the configure the display of UI. It takes `Display` as a value. | +| `prompt?` | Prompt shown to the user during authentication process. It takes `Prompt` as a value. | +| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `String` as a value. | +| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. | +| `id_token_hint?` | It denotes the previously issued ID token. It takes `String` as a value. | +| `id_token?` | JWT (ID Token) to be passed for login. | +| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `String` as a value. | +| `acr_values?` | acc_values | +| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `String` as a value. | +| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `String` as a value. | +| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `String` as a value. | +| `state?` | state | +| `response_type?` | Defines which grant to execute for the authorization server. It takes `String` as a value. | +| `nonce?` | nonce | +| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. | @@ -525,8 +540,9 @@ final Web3AuthResponse response = await Web3AuthFlutter.login( ### Email Passwordless -To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` parameter of the `ExtraLoginOptions`. By default, the login 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 `ExtraLoginOptions`. +To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` parameter of the `ExtraLoginOptions`. By default, the login +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 +`ExtraLoginOptions`. ```dart Future initWeb3Auth() async { diff --git a/docs/sdk/pnp/flutter/initialize.mdx b/docs/sdk/pnp/flutter/initialize.mdx index 52b99a447..7d7ba3273 100644 --- a/docs/sdk/pnp/flutter/initialize.mdx +++ b/docs/sdk/pnp/flutter/initialize.mdx @@ -59,17 +59,17 @@ The `Web3AuthFlutter` takes an object called `Web3AuthOptions` as input. Below a -| Parameter | Type | Mandatory | Description | -| ---------------- | ------------------------------------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------ | -| `clientId` | `String` | Yes | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. | -| `network` | [Network](https://pub.dev/documentation/web3auth_flutter/latest/enums/Network.html) | Yes | Web3Auth Network, `sapphire_mainnet`, `sapphire_devnet`, `mainnet`, `cyan`, `aqua` or `testnet` | -| `redirectUrl` | [Uri class](https://api.dart.dev/stable/2.18.0/dart-core/Uri-class.html) | Yes | URL that Web3Auth will redirect API responses | -| `whiteLabel` | [WhiteLabelData](https://pub.dev/documentation/web3auth_flutter/latest/input/WhiteLabelData-class.html) | No | An optional configuration object to customize UI, branding, and translations for your brand. Refer WhiteLabel section for more info. | -| `loginConfig` | `HashMap` | No | Login config object | -| `useCoreKitKey` | `bool` | No | Use CoreKit Key to get core kit key. | -| `chainNamespace` | [ChainNamespace](https://pub.dev/documentation/web3auth_flutter/latest/enums/ChainNamespace.html) | No | Chain Namespace [`eip155` and `solana`] | -| `mfaSettings` | [MfaSettings](https://pub.dev/documentation/web3auth_flutter/latest/input/MfaSettings-class.html) | No | MFA Settings | -| `sessionTime` | `int` | No | Session Time in seconds, default is `86400` seconds which is 1 day. `sessionTime` can be max 7 days. | +| Parameter | Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `String` | +| `network` | Web3Auth Network, `sapphire_mainnet`, `sapphire_devnet`, `mainnet`, `cyan`, `aqua` or `testnet`. It's a mandatory field of type [Network](https://pub.dev/documentation/web3auth_flutter/latest/enums/Network.html). | +| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type [Uri](https://api.dart.dev/stable/2.18.0/dart-core/Uri-class.html). | +| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes [WhiteLabelData](https://pub.dev/documentation/web3auth_flutter/latest/input/WhiteLabelData-class.html) as a value. | +| `loginConfig?` | Login config for the custom verifiers. It takes `HashMap` as a value. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `chainNamespace?` | Chain Namespace [`eip155` and `solana`]. It takes [ChainNamespace](https://pub.dev/documentation/web3auth_flutter/latest/enums/ChainNamespace.html) as a value. | +| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes [MfaSettings](https://pub.dev/documentation/web3auth_flutter/latest/input/MfaSettings-class.html) as a value. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. [sessionTime] can be max 7 days | diff --git a/docs/sdk/pnp/flutter/mfa.mdx b/docs/sdk/pnp/flutter/mfa.mdx index 4ffa79bf2..ed66a50c7 100644 --- a/docs/sdk/pnp/flutter/mfa.mdx +++ b/docs/sdk/pnp/flutter/mfa.mdx @@ -16,8 +16,8 @@ recover your account if you lose access to your original device or helps login i :::note Minimum Growth plan required -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -105,12 +105,12 @@ Plan**. You can use this feature in the development environment for free. -| Parameter | Type | Mandatory | Description | -| --------------------- | ----------- | --------- | ----------------------------------| -| `deviceShareFactor` | `MfaSetting`| No | MFA setting for deviceShareFactor | -| `backUpShareFactor` | `MfaSetting`| No | MFA setting for backUpShareFactor | -| `socialBackupFactor` | `MfaSetting`| No | MFA setting for socialBackupFactor| -| `passwordFactor` | `MfaSetting`| No | MFA setting for passwordFactor | +| Parameter | Description | +| --------------------- | ----------------------------------------------------------------------- | +| `deviceShareFactor?` | MFA setting for deviceShareFactor. It accepts `MfaSetting` as a value. | +| `backUpShareFactor?` | MFA setting for backUpShareFactor. It accepts `MfaSetting` as a value. | +| `socialBackupFactor?` | MFA setting for socialBackupFactor. It accepts `MfaSetting` as a value. | +| `passwordFactor?` | MFA setting for passwordFactor. It accepts `MfaSetting` as a value. | @@ -156,11 +156,11 @@ class MfaSettings { -| Parameter | Type | Mandatory | Description | -| ----------- | ------ | --------- | ---------------------- | -| `enable` | `bool` | Yes | Enable/Disable MFA | -| `priority` | `int` | No | Priority of MFA | -| `mandatory` | `bool` | No | Mandatory/Optional MFA | +| Parameter | Description | +| ------------ | ------------------------------------------------------------------------------- | +| `enable` | Enable/Disable MFA. It accepts `bool` as a value. | +| `priority?` | Priority of MFA. It accepts `int` as a value, where valid range is from 1 to 4. | +| `mandatory?` | Mandatory/Optional MFA. It acccepts `bool` as a value. | @@ -182,7 +182,6 @@ class MfaSetting { - ```dart Future initWeb3Auth() async { diff --git a/docs/sdk/pnp/flutter/usage.mdx b/docs/sdk/pnp/flutter/usage.mdx index 69c5bfd47..d3a9e214c 100644 --- a/docs/sdk/pnp/flutter/usage.mdx +++ b/docs/sdk/pnp/flutter/usage.mdx @@ -31,15 +31,15 @@ the login method for specific social logins such as GOOGLE, APPLE, FACEBOOK, etc -| Parameter | Type | Mandatory | Description | -| ------------------- | ------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `loginProvider` | `Provider` | Yes | Login provider, supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS` | -| `extraLoginOptions` | `ExtraLoginOptions` | No | You can pass various oAuth supported options, default is `null` | -| `redirectUrl` | `Uri` | No | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated, default is `null` | -| `appState` | `String` | No | `appState` can be used to keep track of the app state when user will be redirected to app after login, default is `null` | -| `mfaLevel` | `Map` | No | MFA level can be used to pass 2FA screen shown during login, default is `mfaLevel.DEFAULT`, shown every 3rd login. | -| `dappShare` | `String` | No | Dapp share can be used to pass dapp share url, default is `null` | -| `curve` | `Map` | No | Curve can be used to pass curve options, `ED25519` for Solana and `SECP256K1` for Ethereum | +| Parameter | Description | +| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginProvider` | It sets the oAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | +| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding [loginProvider]. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `ExtraLoginOptions` as a value. | +| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null` | +| `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `null`, and accepts `String` as a value. | +| `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MFALevel.DEFAULT`, which shows MFA screen every 3rd login. It accepts `MFALevel` as a value. | +| `dappShare?` | Custom verifier logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. It accepts `String` as a value. | +| `curve?` | It will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. This parameter won't change format of private key returned by We3Auth. Private key returned by `getPrivKey` is always secp256k1. To get the ed25519 key you can use `getEd25519PrivKey` method. The default value is `Curve.secp256k1`. | @@ -49,7 +49,6 @@ the login method for specific social logins such as GOOGLE, APPLE, FACEBOOK, etc class LoginParams { final Provider loginProvider; final String? dappShare; - final int? sessionTime; final Curve? curve; final ExtraLoginOptions? extraLoginOptions; final Uri? redirectUrl; @@ -59,7 +58,6 @@ class LoginParams { LoginParams({ required this.loginProvider, this.dappShare, - this.sessionTime, this.curve, this.extraLoginOptions, this.redirectUrl, @@ -70,7 +68,6 @@ class LoginParams { Map toJson() => { "loginProvider": loginProvider.name, "dappShare": dappShare, - "sessionTime": sessionTime, "curve": curve?.name, "extraLoginOptions": extraLoginOptions?.toJson(), "redirectUrl": redirectUrl?.toString(), @@ -79,13 +76,14 @@ class LoginParams { }; } ``` + ### `getPrivkey()` -Use getPrivkey() to get the private key of the user. The method returns an EVM compatible private key which can be -used to sign transactions on EVM compatible chains. +Use getPrivkey() to get the private key of the user. The method returns an EVM compatible private key which can be used to sign transactions on EVM +compatible chains. ### `getEd25519PrivKey()` @@ -342,145 +340,11 @@ final Web3AuthResponse response = await Web3AuthFlutter.login( ``` - - - -## ExtraLoginOptions - -### Arguments - -`ExtraLoginOptions` - -```dart -Web3AuthFlutter.login( - LoginParams( - loginProvider: selectedLoginProvider, - // highlight-next-line - extraLoginOptions: ExtraLoginOptions(login_hint: "hello@web3auth.io") - ), -) -``` - - - - - -| Parameter | Type | Mandatory | Description | -| ----------------------------| ------------------------- | --------- | ----------------------------------------------------------------- | -| `additionalParams` | `Map?` | No | additionalParams, use id_token(JWT) to authenticate with web3auth | -| `domain` | `String?` | No | Domain of the app | -| `client_id` | `String?` | No | client_id from Web3Auth Dashboard | -| `leeway` | `String?` | No | leeway | -| `verifierIdField` | `String?` | No | verifierIdField | -| `isVerifierIdCaseSensitive` | `bool?` | No | Boolean to confirm the case sensitivity of VerifierId | -| `display` | `Display?` | No | Display | -| `prompt` | `Prompt?` | No | Prompt | -| `max_age` | `String?` | No | max_age | -| `ui_locales` | `String?` | No | ui_locales to be shown on the modal | -| `id_token_hint` | `String?` | No | Previously issued ID Token. | -| `id_token` | `String?` | No | JWT (ID Token) to be passed for Login. | -| `login_hint` | `String?` | No | Email used for EMAIL_PASSWORDLESS | -| `acr_values` | `String?` | No | acc_values | -| `scope` | `String?` | No | scope | -| `audience` | `String?` | No | audience | -| `connection` | `String?` | No | connection | -| `state` | `String?` | No | state | -| `response_type` | `String?` | No | response_type | -| `nonce` | `String?` | No | nonce | -| `redirect_uri` | `String?` | No | redirect_uri | - - - - - -```dart -class ExtraLoginOptions { - final Map? additionalParams; - final String? domain; - final String? client_id; - final String? leeway; - final String? verifierIdField; - final bool? isVerifierIdCaseSensitive; - final Display? display; - final Prompt? prompt; - final String? max_age; - final String? ui_locales; - final String? id_token_hint; - final String? id_token; - final String? login_hint; - final String? acr_values; - final String? scope; - final String? audience; - final String? connection; - final String? state; - final String? response_type; - final String? nonce; - final String? redirect_uri; - - ExtraLoginOptions({ - this.additionalParams = const {}, - this.domain, - this.client_id, - this.leeway, - this.verifierIdField, - this.isVerifierIdCaseSensitive, - this.display, - this.prompt, - this.max_age, - this.ui_locales, - this.id_token_hint, - this.id_token, - this.login_hint, - this.acr_values, - this.scope, - this.audience, - this.connection, - this.state, - this.response_type, - this.nonce, - this.redirect_uri, - }); - - Map toJson() => { - "additionalParams": additionalParams, - "domain": domain, - "client_id": client_id, - "leeway": leeway, - "verifierIdField": verifierIdField, - "isVerifierIdCaseSensitive": isVerifierIdCaseSensitive, - "display": display?.name, - "prompt": prompt?.name, - "max_age": max_age, - "ui_locales": ui_locales, - "id_token_hint": id_token_hint, - "id_token": id_token, - "login_hint": login_hint, - "acr_values": acr_values, - "scope": scope, - "audience": audience, - "connection": connection, - "state": state, - "response_type": response_type, - "nonce": nonce, - "redirect_uri": redirect_uri, - }; -} -``` - - - ## Selecting Curve -The `LoginParams` class has a `curve` parameter. This parameter can be used to select the elliptic curve to use for the -signature. +The `LoginParams` class has a `curve` parameter. This parameter can be used to select the elliptic curve to use for the signature. ```dart final Web3AuthResponse response = await Web3AuthFlutter.login(LoginParams( @@ -589,9 +453,9 @@ Get started with a sample app found [here](/examples?product=Plug+and+Play&sdk=P ### `setResultUrl()` -This method will trigger login exceptions for Android. For iOS, you don't need this method to trigger -the login exceptions. The Android SDK usees the custom tabs and from current implementation of chrome custom tab, -that's not possible to add a listener directly to chrome custom tab close button and trigger login exceptions. +This method will trigger login exceptions for Android. For iOS, you don't need this method to trigger the login exceptions. The Android SDK usees the +custom tabs and from current implementation of chrome custom tab, that's not possible to add a listener directly to chrome custom tab close button and +trigger login exceptions. Hence, it's necessary to user `setResultUrl` method in your login screen to trigger exceptions. diff --git a/docs/sdk/pnp/flutter/whitelabel.mdx b/docs/sdk/pnp/flutter/whitelabel.mdx index 0f0fb90fa..c7945da74 100644 --- a/docs/sdk/pnp/flutter/whitelabel.mdx +++ b/docs/sdk/pnp/flutter/whitelabel.mdx @@ -13,8 +13,8 @@ For defining custom UI, branding, and translations for your brand app, you just :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -32,16 +32,16 @@ This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricin -| Parameter | Type | Mandatory | Description | -| ----------------- | ------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `appName` | `String` | `false` | Name of the app | -| `logoLight` | `String` | `false` | App logo to be shown on the light background (dark mode) | -| `logoDark` | `String` | `false` | App logo to be shown on the dark background (light mode) | -| `defaultLanguage` | `Language` | `false` | Default Language to use.
Choose from:
  • `en` - English
  • `de` - German
  • `ja` - Japanese
  • `ko` - Korean
  • `zh` - Mandarin
  • `es` - Spanish
  • `fr` - French
  • `pt` - Portuguese
  • `nl` - Dutch
| -| `mode` | `ThemeModes` | `false` | Choose between `auto`, `light` or `dark` background modes. | -| `theme` | `HashMap` | `false` | Custom theme for the app | -| `appUrl` | `String` | `false` | App URL | -| `useLogoLoader` | `bool` | `false` | Use logo as loader | +| Parameter | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `appName?` | Display name for the app in the UI. | +| `logoLight?` | App logo to be used in dark mode. It accepts url in `String` as a value. | +| `logoDark?` | App logo to be used in light mode. It accepts url in `String` as a value. | +| `defaultLanguage?` | Language which will be used by Web3Auth, app will use browser language if not specified. Default language is `Language.en`. Checkout `Language` for supported languages. | +| `mode?` | Theme mode for the login modal. Choose between `ThemeModes.auto`, `ThemeModes.light` or `ThemeModes.dark` background modes. Default value is `ThemeModes.auto`. | +| `theme?` | Used to customize the theme of the login modal. It accepts `HashMap` as a value. | +| `appUrl?` | Url to be used in the Modal. It accepts url in `String` as a value. | +| `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are null, the default Web3Auth logo will be used for the loader. Default value is false. |
From b1aa8a9cbbea77b3253e1b9e52e597bbe7b60ca3 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Mon, 11 Mar 2024 21:55:47 +0530 Subject: [PATCH 2/9] update docs for Android --- .../sdk/pnp/android/custom-authentication.mdx | 65 +++++---- docs/sdk/pnp/android/initialize.mdx | 72 ++-------- docs/sdk/pnp/android/mfa.mdx | 55 +++++--- docs/sdk/pnp/android/usage.mdx | 125 +++--------------- docs/sdk/pnp/android/whitelabel.mdx | 24 ++-- docs/sdk/pnp/flutter/initialize.mdx | 2 +- docs/sdk/pnp/flutter/usage.mdx | 2 +- 7 files changed, 126 insertions(+), 219 deletions(-) diff --git a/docs/sdk/pnp/android/custom-authentication.mdx b/docs/sdk/pnp/android/custom-authentication.mdx index df7ce38b2..46fe49501 100644 --- a/docs/sdk/pnp/android/custom-authentication.mdx +++ b/docs/sdk/pnp/android/custom-authentication.mdx @@ -18,8 +18,8 @@ First, configure your own verifier in the Web3Auth Dashboard to use custom authe :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -55,21 +55,21 @@ Then, you should specify the details of your verifier in the `LoginConfigItem` s -| Parameter | Type | Mandatory | Description | -| ----------------------- | ------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `verifier` | `String` | Yes | The name of the verifier that you have registered on the Web3Auth Dashboard. | -| `typeOfLogin` | `TypeOfLogin` | Yes | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose google, a google sign-in flow will be used. If you choose jwt, which you should be providing your own JWT token, no sign-in flow will be presented. | -| `clientId` | `String` | Yes | The Client Id of the login provider. e.g. Google's Client ID | -| `name` | `String?` | No | Name of your verifier. | -| `description` | `String?` | No | Description of this login flow. | -| `verifierSubIdentifier` | `String?` | No | The name of the field in the JWT that should be used as the unique user ID of the JWT. Should be same as the one you used | -| `logoHover` | `String?` | No | Logo to be shown on mouse hover. | -| `logoLight` | `String?` | No | Light logo for dark background | -| `logoDark` | `String?` | No | Dark logo for light background | -| `mainOption` | `Boolean?` | No | Show login button on the main list | -| `showOnModal` | `Boolean?` | No | Whether to show the login button on modal or not | -| `showOnDesktop` | `Boolean?` | No | Whether to show the login button on desktop | -| `showOnMobile` | `Boolean?` | No | Whether to show the login button on mobile | +| Parameter | Description | +| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `String` as a value. | +| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `TypeOfLogin` as a value. | +| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `String` as a value. | +| `name?` | Display name for the verifier. If null, the default name is used. It accepts `String` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `String` as a value. | +| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `String` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `String` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `String` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `String` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `Boolean` as a value. Default value is false. | +| `showOnModal?` | Whether to show the login button on modal or not. Default value is true. | +| `showOnDesktop?` | Whether to show the login button on desktop. Default value is true. | +| `showOnMobile?` | Whether to show the login button on mobile. Default value is true. | @@ -254,14 +254,29 @@ enabling login. The `ExtraLoginOptions` accepts the following parameters: -| Parameter | Type | Description | -| --------------------------- | --------- | ----------------------------------------------------------------------------------------- | -| `domain` | `String` | Your Auth0 account domain such as `example.auth0.com` or `example.mycompany.com` etc. | -| `client_id` | `String` | The Client ID found on your Auth0 Application settings page. | -| `redirect_uri` | `String` | The default URL where Auth0 will redirect your browser to with the authentication result. | -| `leeway` | `String` | The value in seconds used to account for clock skew in JWT expirations. | -| `verifierIdField` | `String` | The field in jwt token which maps to verifier id. | -| `isVerifierIdCaseSensitive` | `Boolean` | Whether the verifier id field is case sensitive. Defaults to `true` | +| Parameter | Description | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalParams?` | Additional params in `HashMap` format for OAuth login, use id_token(JWT) to authenticate with web3auth. | +| `domain?` | Your custom authentication domain in `String` format. For example, if you are using Auth0, it can be example.au.auth0.com. | +| `client_id?` | Client id in `String` format, provided by your login provider used for custom verifier. | +| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `String` as a value. | +| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `String` as a value. | +| `isVerifierIdCaseSensitive?` | Boolean to confirm Whether the verifier id field is case sensitive or not. | +| `display?` | Allows developers the configure the display of UI. It takes `Display` as a value. | +| `prompt?` | Prompt shown to the user during authentication process. It takes `Prompt` as a value. | +| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `String` as a value. | +| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. | +| `id_token_hint?` | It denotes the previously issued ID token. It takes `String` as a value. | +| `id_token?` | JWT (ID Token) to be passed for login. | +| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `String` as a value. | +| `acr_values?` | acc_values | +| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `String` as a value. | +| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `String` as a value. | +| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `String` as a value. | +| `state?` | state | +| `response_type?` | Defines which grant to execute for the authorization server. It takes `String` as a value. | +| `nonce?` | nonce | +| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. | diff --git a/docs/sdk/pnp/android/initialize.mdx b/docs/sdk/pnp/android/initialize.mdx index c1f53ca6f..1fa0f7169 100644 --- a/docs/sdk/pnp/android/initialize.mdx +++ b/docs/sdk/pnp/android/initialize.mdx @@ -42,19 +42,18 @@ The Web3Auth Constructor takes an object with `Web3AuthOptions` as input. -| Parameter | Type | Mandatory | Description | -| ---------------- | ------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `context` | `android.content.Context` | Yes | Android context to launch Web-based authentication, usually is the current activity | -| `clientId` | `String` | Yes | Your Web3Auth Project ID | -| `network` | `Network` | Yes | Network to run Web3Auth, either `MAINNET`, `TESTNET`, `AQUA`, `CYAN`, `SAPPHIRE_MAINNET` or `SAPPHIRE_TESTNET` | -| `buildEnv` | `BuildEnv` | No | Option for auth service, `BuildEnv.PRODUCTION`, `BuildEnv.STAGING`, `BuildEnv.TESTING` available | -| `redirectUrl` | `android.net.Uri` | No | URL that Web3Auth will redirect API responses, default is `null` | -| `whiteLabel` | `WhiteLabelData` | No | A configuration optional object to customize UI, branding, and translations for your brand. Refer [WhiteLabel](/pnp/features/whitelabel) section for more info. | -| `loginConfig` | `LoginConfigItem` | No | A configuration optional object to use custom authentication. Refer [Custom Authentication](/pnp/features/custom-authentication) for more info. | -| `useCoreKitKey` | `Boolean` | No | Use Core Kit Key true to the Core Kit keys. | -| `chainNamespace` | `ChainNamespace` | No | A configuration optional object to use chain namespace. `EIP155`, `SOLANA` are the availale namespaces. | -| `mfaSettings` | `MfaSettings` | No | MFA Settings | -| `sessionTime` | `Int` | No | Session Time in seconds, default is `86400` seconds | +| Parameter | Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `context` | Android context to launch Web-based authentication, usually is the current activity. It's a mandatory field, and accepts `android.content.Context` as a value. | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `String` | +| `network` | Defines the Web3Auth network. It's a mandatory field of type Network. | +| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `Uri`. | +| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | +| `loginConfig?` | Login config for the custom verifiers. It takes `HashMap` as a value. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `chainNamespace?` | Chain Namespace [`EIP155` and `SOLANA`]. It takes `ChainNamespace` as a value. | +| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `MfaSettings` as a value. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | @@ -107,53 +106,6 @@ Add the below line to your `app/res/values/strings.xml` file: ``` -### Using the `mfaSettings` to configure MFA Order - -You can configure the order of MFA or enable/disable MFA type by passing the `mfaSettings` object in `Web3AuthOptions`. - -`MfaSettings` - - - - - -`deviceShareFactor` | `backUpShareFactor` | `socialBackupFactor` | `passwordFactor` - -| Parameter | Type | Mandatory | Description | -| ----------- | ---------- | --------- | ---------------------- | -| `enable` | `Boolean` | Yes | Enable/Disable MFA | -| `priority` | `Int?` | No | Priority of MFA | -| `mandatory` | `Boolean?` | No | Mandatory/Optional MFA | - - - - - -```kotlin - data class MfaSetting( - var enable: Boolean, - var priority: Int?, - var mandatory: Boolean? - ) - - data class MfaSettings( - private var deviceShareFactor: MfaSetting? = null, - private var backUpShareFactor: MfaSetting? = null, - private var socialBackupFactor: MfaSetting? = null, - private var passwordFactor: MfaSetting? = null, - ) -``` - - - - - ### Session Management The Session Management feature allows you to check the existing sessions with Web3Auth. The `sessionResponse()` will allow users to remain diff --git a/docs/sdk/pnp/android/mfa.mdx b/docs/sdk/pnp/android/mfa.mdx index eca8f9059..4b6892a94 100644 --- a/docs/sdk/pnp/android/mfa.mdx +++ b/docs/sdk/pnp/android/mfa.mdx @@ -33,8 +33,8 @@ screen will continue to appear if the user has enabled MFA on other dApps. This :::note Minimum Growth plan required -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -105,25 +105,18 @@ You can configure the order of MFA or enable/disable MFA type by passing the `mf -`deviceShareFactor` | `backUpShareFactor` | `socialBackupFactor` | `passwordFactor` - -| Parameter | Type | Mandatory | Description | -| ----------- | ------ | --------- | ---------------------- | -| `enable` | `bool` | Yes | Enable/Disable MFA | -| `priority` | `int` | No | Priority of MFA | -| `mandatory` | `bool` | No | Mandatory/Optional MFA | +| Parameter | Description | +| --------------------- | ----------------------------------------------------------------------- | +| `deviceShareFactor?` | MFA setting for deviceShareFactor. It accepts `MfaSetting` as a value. | +| `backUpShareFactor?` | MFA setting for backUpShareFactor. It accepts `MfaSetting` as a value. | +| `socialBackupFactor?` | MFA setting for socialBackupFactor. It accepts `MfaSetting` as a value. | +| `passwordFactor?` | MFA setting for passwordFactor. It accepts `MfaSetting` as a value. | ```kotlin - data class MfaSetting( - var enable: Boolean, - var priority: Int?, - var mandatory: Boolean? - ) - data class MfaSettings( private var deviceShareFactor: MfaSetting? = null, private var backUpShareFactor: MfaSetting? = null, @@ -133,7 +126,39 @@ You can configure the order of MFA or enable/disable MFA type by passing the `mf ``` + + +`MfaSetting` + + + + + +| Parameter | Description | +| ------------ | ------------------------------------------------------------------------------- | +| `enable` | Enable/Disable MFA. It accepts `Boolean` as a value. | +| `priority?` | Priority of MFA. It accepts `int` as a value, where valid range is from 1 to 4. | +| `mandatory?` | Mandatory/Optional MFA. It acccepts `Boolean` as a value. | + + + + +```kotlin + data class MfaSetting( + var enable: Boolean, + var priority: Int?, + var mandatory: Boolean? + ) +``` + + ```kotlin diff --git a/docs/sdk/pnp/android/usage.mdx b/docs/sdk/pnp/android/usage.mdx index 6b7d83f15..d0401ebf0 100644 --- a/docs/sdk/pnp/android/usage.mdx +++ b/docs/sdk/pnp/android/usage.mdx @@ -33,15 +33,15 @@ the login method for specific social logins such as GOOGLE, APPLE, FACEBOOK, etc -| Parameter | Type | Mandatory | Description | -| ------------------- | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `loginProvider` | `Provider` | Yes | Login provider, supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`, `JWT` | -| `dappShare` | `String` | No | Dapp share can be used to pass dapp share url, default is `null` | -| `extraLoginOptions` | `ExtraLoginOptions` | No | You can pass various oauth supported options, default is `null` | -| `redirectUrl` | `Uri` | No | Uri where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated, default is `null` | -| `appState` | `String` | No | appState can be used to keep track of the app state when user will be redirected to app after login, default is `null` | -| `mfaLevel` | `MFALevel` | No | MFA level can be used to pass 2FA screen shown during login, default is `mfaLevel.DEFAULT`, shown every 3rd login. | -| `curve` | `Curve` | No | Curve can be used to pass curve options, `ED25519` for Solana and `SECP256K1` for Ethereum | +| Parameter | Description | +| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginProvider` | It sets the OAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | +| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding `loginProvider`. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `ExtraLoginOptions` as a value. | +| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null`, and accepts `Uri` as a value. | +| `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `null`, and accepts `String` as a value. | +| `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MFALevel.DEFAULT`, which shows MFA screen every 3rd login. It accepts `MFALevel` as a value. | +| `dappShare?` | Custom verifier logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. It accepts `String` as a value. | +| `curve?` | It will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. This parameter won't change format of private key returned by We3Auth. Private key returned by `getPrivKey` is always secp256k1. To get the ed25519 key you can use `getEd25519PrivKey` method. The default value is `Curve.SECP256K1`. | @@ -363,91 +363,6 @@ class MainActivity : AppCompatActivity() { ``` - - - -## ExtraLoginOptions - -### Arguments - -`ExtraLoginOptions` - -```kotlin -web3Auth.login( - LoginParams( - selectedLoginProvider, - extraLoginOptions = ExtraLoginOptions(login_hint = "hello@web3auth.io") - ) -) -``` - - - - - -| Parameter | Type | Mandatory | Description | -| --------------------------- | -------------------------- | --------- | ----------------------------------------------------------------- | -| `additionalParams` | `HashMap\` | No | additionalParams, use id_token(JWT) to authenticate with web3auth | -| `domain` | `String` | No | Domain of the app | -| `client_id` | `String` | No | client_id from Web3Auth Dashboard | -| `leeway` | `String` | No | leeway | -| `verifierIdField` | `String` | No | verifierIdField | -| `isVerifierIdCaseSensitive` | `Boolean` | No | Boolean to confirm the case sensitivity of VerifierId | -| `display` | `Display` | No | Display | -| `prompt` | `Prompt` | No | Prompt | -| `max_age` | `String` | No | max_age | -| `ui_locales` | `String` | No | ui_locales to be shown on the modal | -| `id_token` | `String` | No | JWT (ID Token) to be passed for Login. | -| `id_token_hint` | `String` | No | Previously issued ID Token. | -| `login_hint` | `String` | No | Email used for EMAIL_PASSWORDLESS | -| `acr_values` | `String` | No | acc_values | -| `scope` | `String` | No | scope | -| `audience` | `String` | No | audience | -| `connection` | `String` | No | connection | -| `state` | `String` | No | state | -| `response_type` | `String` | No | response_type | -| `nonce` | `String` | No | nonce | -| `redirect_uri` | `String` | No | redirect_uri | - - - - - -```kotlin -data class ExtraLoginOptions( - private var additionalParams : HashMap? = null, - private var domain : String? = null, - private var client_id : String? = null, - private var leeway : String? = null, - private var verifierIdField : String? =null, - private var isVerifierIdCaseSensitive : Boolean? = null, - private var display : Display? = null, - private var prompt : Prompt? = null, - private var max_age : String? = null, - private var ui_locales : String? = null, - private var id_token : String? = null, - private var id_token_hint : String? = null, - private var login_hint : String? = null, - private var acr_values : String? = null, - private var scope : String? = null, - private var audience : String? = null, - private var connection : String? = null, - private var state : String? = null, - private var response_type : String? = null, - private var nonce : String? = null, - private var redirect_uri : String? = null -) - -``` - - - ## Selecting Curve @@ -654,17 +569,17 @@ The `launchWalletServices` method launches a WebView which allows you to use the -| Parameter | Type | Mandatory | Description | -| ------------------ | ---------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- | -| `chainNamespace` | `ChainNamespace` | No | Custom configuration for your preferred blockchain. As of now only EVM supported. Default value is `ChainNamespace.EIP155`. | -| `decimals` | `Int` | No | Number of decimals for the currency ticker. Default value is 18 | -| `blockExplorerUrl` | `String` | No | Blockchain's explorer URL. (eg: `https://etherscan.io`) | -| `chainId` | `String` | Yes | The chain id of the selected blockchain in `hex`. | -| `displayName` | `String` | No | Display Name for the chain. | -| `logo` | `String` | No | Logo for the selected `chainNamespace` & `chainId`. | -| `rpcTarget` | `String` | Yes | RPC Target URL for the selected `chainNamespace` & `chainId`. | -| `ticker` | `String` | Yes | Default currency ticker of the network (e.g: `ETH`) | -| `tickerName` | `String` | No | Name for currency ticker (e.g: `Ethereum`) | +| Parameter | Description | +| ------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `chainNamespace` | Custom configuration for your preferred blockchain. As of now only EVM supported. Default value is `ChainNamespace.EIP155`. | +| `decimals` | Number of decimals for the currency ticker. Default value is 18, and accepts `Int` as value. | +| `blockExplorerUrl?` | Blockchain's explorer URL. (eg: `https://etherscan.io`) | +| `chainId` | The chain id of the selected blockchain in hex `String`. | +| `displayName?` | Display Name for the chain. | +| `logo?` | Logo for the selected `chainNamespace` & `chainId`. | +| `rpcTarget` | RPC Target URL for the selected `chainNamespace` & `chainId`. | +| `ticker` | Default currency ticker of the network (e.g: `ETH`) | +| `tickerName?` | Name for currency ticker (e.g: `Ethereum`) | diff --git a/docs/sdk/pnp/android/whitelabel.mdx b/docs/sdk/pnp/android/whitelabel.mdx index 1c9fbd6cf..a089eea34 100644 --- a/docs/sdk/pnp/android/whitelabel.mdx +++ b/docs/sdk/pnp/android/whitelabel.mdx @@ -13,8 +13,8 @@ object called `whiteLabel`. This parameter takes object called `WhiteLabelData`. :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -32,16 +32,16 @@ This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricin -| Parameter | Type | Description | Default | Mandatory | -| ------------------ | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | --------- | -| `appName?` | `String` | App name to be displayed in the User Flow Screens. | dApp's Website URL | No | -| `appUrl?` | `String` | App URL to be displayed in the User Flow Screens. | dApp's Website URL | No | -| `logoLight?` | `String` | App logo to be shown on the dark background (dark theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `logoDark?` | `String` | App logo to be shown on the light background (light theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `defaultLanguage?` | `Language` | Default Language to use.
Choose from:
  • `Language.EN` - English
  • `Language.DE` - German
  • `Language.JA` - Japanese
  • `Language.KO` - Korean
  • `Language.ZH` - Mandarin
  • `Language.ES` - Spanish
  • `Language.FR` - French
  • `Language.PT` - Portuguese
  • `Language.NL` - Dutch
| `Language.EN` | No | -| `mode?` | `ThemeModes` | Choose between `AUTO`, `LIGHT` or `DARK` modes. | `ThemeModes.AUTO` | No | -| `theme?` | `HashMap?` | Used to customize the theme of the login modal with the following options
`'primary'` - To customize the primary color of the modal's content | `#0364FF` | No | -| `useLogoLoader` | `Boolean` | Loads the logo when loading | false | No | +| Parameter | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `appName?` | Display name for the app in the UI. | +| `logoLight?` | App logo to be used in dark mode. It accepts url in `String` as a value. | +| `logoDark?` | App logo to be used in light mode. It accepts url in `String` as a value. | +| `defaultLanguage?` | Language which will be used by Web3Auth, app will use browser language if not specified. Default language is `Language.EN`. Checkout `Language` for supported languages. | +| `mode?` | Theme mode for the login modal. Choose between `ThemeModes.AUTO`, `ThemeModes.LIGHT` or `ThemeModes.DARK` background modes. Default value is `ThemeModes.AUTO`. | +| `theme?` | Used to customize the theme of the login modal. It accepts `HashMap` as a value. | +| `appUrl?` | Url to be used in the Modal. It accepts url in `String` as a value. | +| `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are null, the default Web3Auth logo will be used for the loader. Default value is false. |
diff --git a/docs/sdk/pnp/flutter/initialize.mdx b/docs/sdk/pnp/flutter/initialize.mdx index 7d7ba3273..e66c9d26c 100644 --- a/docs/sdk/pnp/flutter/initialize.mdx +++ b/docs/sdk/pnp/flutter/initialize.mdx @@ -69,7 +69,7 @@ The `Web3AuthFlutter` takes an object called `Web3AuthOptions` as input. Below a | `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | | `chainNamespace?` | Chain Namespace [`eip155` and `solana`]. It takes [ChainNamespace](https://pub.dev/documentation/web3auth_flutter/latest/enums/ChainNamespace.html) as a value. | | `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes [MfaSettings](https://pub.dev/documentation/web3auth_flutter/latest/input/MfaSettings-class.html) as a value. | -| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. [sessionTime] can be max 7 days | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | diff --git a/docs/sdk/pnp/flutter/usage.mdx b/docs/sdk/pnp/flutter/usage.mdx index d3a9e214c..130e0dae5 100644 --- a/docs/sdk/pnp/flutter/usage.mdx +++ b/docs/sdk/pnp/flutter/usage.mdx @@ -34,7 +34,7 @@ the login method for specific social logins such as GOOGLE, APPLE, FACEBOOK, etc | Parameter | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `loginProvider` | It sets the oAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | -| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding [loginProvider]. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `ExtraLoginOptions` as a value. | +| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding `loginProvider`. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `ExtraLoginOptions` as a value. | | `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null` | | `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `null`, and accepts `String` as a value. | | `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MFALevel.DEFAULT`, which shows MFA screen every 3rd login. It accepts `MFALevel` as a value. | From b879e843e411e1578d09806ad3eea5a0bb1add45 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Mon, 11 Mar 2024 22:15:13 +0530 Subject: [PATCH 3/9] update docs for iOS --- docs/sdk/pnp/android/mfa.mdx | 2 +- docs/sdk/pnp/ios/custom-authentication.mdx | 72 +++++++++------- docs/sdk/pnp/ios/initialize.mdx | 24 +++--- docs/sdk/pnp/ios/mfa.mdx | 71 +++++++++++----- docs/sdk/pnp/ios/usage.mdx | 97 +++------------------- docs/sdk/pnp/ios/whitelabel.mdx | 27 +++--- 6 files changed, 129 insertions(+), 164 deletions(-) diff --git a/docs/sdk/pnp/android/mfa.mdx b/docs/sdk/pnp/android/mfa.mdx index 4b6892a94..6e0cdf863 100644 --- a/docs/sdk/pnp/android/mfa.mdx +++ b/docs/sdk/pnp/android/mfa.mdx @@ -143,7 +143,7 @@ You can configure the order of MFA or enable/disable MFA type by passing the `mf | Parameter | Description | | ------------ | ------------------------------------------------------------------------------- | | `enable` | Enable/Disable MFA. It accepts `Boolean` as a value. | -| `priority?` | Priority of MFA. It accepts `int` as a value, where valid range is from 1 to 4. | +| `priority?` | Priority of MFA. It accepts `Int` as a value, where valid range is from 1 to 4. | | `mandatory?` | Mandatory/Optional MFA. It acccepts `Boolean` as a value. | diff --git a/docs/sdk/pnp/ios/custom-authentication.mdx b/docs/sdk/pnp/ios/custom-authentication.mdx index dc0538800..8da79ca5a 100644 --- a/docs/sdk/pnp/ios/custom-authentication.mdx +++ b/docs/sdk/pnp/ios/custom-authentication.mdx @@ -8,8 +8,8 @@ description: "Web3Auth PnP iOS SDK - Using Custom Authentication | Documentation import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; -To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you can -add the configuration to the `loginConfig` parameter of the `W3AInitParams` object during the initialization. +To use custom authentication (Using Social providers or Login providers like Auth0, AWS Cognito, Firebase etc. or even your own custom JWT login) you +can add the configuration to the `loginConfig` parameter of the `W3AInitParams` object during the initialization. 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 `W3ALoginConfig` struct. @@ -18,8 +18,8 @@ To use custom authentication, first you'll need to configure your own verifier i :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -37,7 +37,8 @@ Check out how to create a **[Custom Verifier](/auth-provider-setup/verifiers)** ::: -Once the custom verifier is created, you need to specify the details of your verifier in the `W3ALoginConfig` struct, the parameters of the struct are as follows: +Once the custom verifier is created, you need to specify the details of your verifier in the `W3ALoginConfig` struct, the parameters of the struct are +as follows: ## `W3ALoginConfig` @@ -55,21 +56,21 @@ Once the custom verifier is created, you need to specify the details of your ver -| Parameter | Type | Mandatory | Description | -| ----------------------- | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `verifier` | `String` | Yes | The name of the verifier that you have registered in Web3Auth Dashboard. | -| `typeOfLogin` | `TypeOfLogin` | Yes | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose google, a google sign-in flow will be used. If you choose jwt, which you should be providing your own JWT token, no sign-in flow will be presented. | -| `clientId` | `String` | Yes | The Web3Auth ClientId you want to use for this login provider. | -| `name` | `String` | No | Name of your verifier. | -| `description` | `String` | No | Description of this login flow. | -| `verifierSubIdentifier` | `String` | No | The name of the field in the JWT that should be used as the unique user ID of the JWT. Should be same as the one you used in the verifier config. | -| `logoHover` | `String` | No | Logo to be shown on mouse hover. | -| `logoLight` | `String` | No | Logo to be shown on light background (light theme). | -| `logoDark` | `String` | No | Logo to be shown on dark background (dark theme). | -| `mainOption` | `Bool?` | No | Show login button on the main list | -| `showOnModal` | `Bool?` | No | Whether to show the login button on modal or not | -| `showOnDesktop` | `Bool?` | No | Whether to show the login button on desktop | -| `showOnMobile` | `Bool?` | No | Whether to show the login button on mobile | +| Parameter | Description | +| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `String` as a value. | +| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `TypeOfLogin` as a value. | +| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `String` as a value. | +| `name?` | Display name for the verifier. If null, the default name is used. It accepts `String` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `String` as a value. | +| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `String` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `String` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `String` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `String` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `Bool` as a value. Default value is false. | +| `showOnModal?` | Whether to show the login button on modal or not. Default value is true. | +| `showOnDesktop?` | Whether to show the login button on desktop. Default value is true. | +| `showOnMobile?` | Whether to show the login button on mobile. Default value is true. | @@ -207,14 +208,29 @@ for enabling login. The `extraLoginOptions` accepts the following parameters: -| Parameter | Type | Description | -| --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| `domain` | `String?` | Your Auth0 account domain such as `example.auth0.com` or `example.mycompany.com` etc. **Use any random string in case of custom JWT login.** | -| `client_id` | `String?` | The Client ID found on your Auth0 Application settings page. **Use web3auth client id in case of custom JWT login.** | -| `redirect_uri` | `String?` | The default URL where Auth0 will redirect your browser to with the authentication result. | -| `leeway` | `Int?` | The value in seconds used to account for clock skew in JWT expirations. | -| `verifierIdField` | `String?` | The field in the jwt token that maps to the verifier id. | -| `isVerifierIdCaseSensitive` | `Bool?` | Whether the verifier id field is case sensitive. Defaults to `true` | +| Parameter | Description | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalParams?` | Additional params in `[String:String]` format for OAuth login, use id_token(JWT) to authenticate with web3auth. | +| `domain?` | Your custom authentication domain in `String` format. For example, if you are using Auth0, it can be example.au.auth0.com. | +| `client_id?` | Client id in `String` format, provided by your login provider used for custom verifier. | +| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `Int` as a value. | +| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `String` as a value. | +| `isVerifierIdCaseSensitive?` | `Bool` to confirm Whether the verifier id field is case sensitive or not. | +| `display?` | Allows developers the configure the display of UI. It takes `String` as a value. | +| `prompt?` | Prompt shown to the user during authentication process. It takes `String` as a value. | +| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `String` as a value. | +| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. | +| `id_token_hint?` | It denotes the previously issued ID token. It takes `String` as a value. | +| `id_token?` | JWT (ID Token) to be passed for login. | +| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `String` as a value. | +| `acr_values?` | acc_values | +| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `String` as a value. | +| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `String` as a value. | +| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `String` as a value. | +| `state?` | state | +| `response_type?` | Defines which grant to execute for the authorization server. It takes `String` as a value. | +| `nonce?` | nonce | +| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. | diff --git a/docs/sdk/pnp/ios/initialize.mdx b/docs/sdk/pnp/ios/initialize.mdx index 5b9176888..a85825ab5 100644 --- a/docs/sdk/pnp/ios/initialize.mdx +++ b/docs/sdk/pnp/ios/initialize.mdx @@ -57,16 +57,14 @@ let web3auth = Web3Auth(W3AInitParams( The `Web3Auth` constructor takes an object called `W3AInitParams` as input. Below are the available fields of the `W3AInitParams` object. -| Parameter | Type | Mandatory | Description | -| ---------------- | -------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientId` | `String` | Yes | Your Web3Auth project Client ID. | -| `network` | `Network` | Yes | Web3Auth Network to run the authentication on, either `.mainnet`,`.aqua`, `.testnet`, `.cyan`, or `.sapphire_devnet` or `.sapphire_mainnet`. | -| `buildEnv` | `BuildEnv` | No | Option for auth service, `production`, `staging`, or `testing`. | -| `sdkUrl` | `URL` | No | Web3Auth sdk frontend to be used. This field is for advanced usage only and should not be changed. | -| `redirectUrl` | `String` | No | redirectUrl to be passed to the SDK frontend. This field is for advanced usage only and should not be changed. | -| `loginConfig` | `[String : W3ALoginConfig]` | No | An optional configuration object to customize login flow. | -| `whiteLabel` | [W3AWhiteLabelData](/sdk/pnp/ios/whitelabel) | No | An optional configuration object to customize UI, branding, and translations for your brand. Refer to the WhiteLabeling section for more info. | -| `chainNamespace` | `ChainNamespace` | No | Chain Namespace [`eip155` and `solana`] | -| `useCoreKitKey` | `bool` | No | Use CoreKit Key to get core kit key. | -| `mfaSettings` | `MfaSettings` | No | Settings for Multi-factor authentication | -| `sessionTime` | `Int` | No | Session time to be passed to set the session of a user that will be returned to Web3AuthState. _**Maximum value is 7 days.**_ | +| Parameter | Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `String` | +| `network` | Defines the Web3Auth network. It's a mandatory field of type Network. | +| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `URL`. | +| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `W3AWhiteLabelData` as a value. | +| `loginConfig?` | Login config for the custom verifiers. It takes Dictonary of `[String: W3ALoginConfig]` as a value. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `chainNamespace?` | Chain Namespace [`eip155` and `solana`]. It takes `ChainNamespace` as a value. | +| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `MfaSettings` as a value. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | diff --git a/docs/sdk/pnp/ios/mfa.mdx b/docs/sdk/pnp/ios/mfa.mdx index 2290cab08..ca4e11b1d 100644 --- a/docs/sdk/pnp/ios/mfa.mdx +++ b/docs/sdk/pnp/ios/mfa.mdx @@ -13,8 +13,8 @@ device and also to recover their account if they lose their original device. :::note Minimum Growth plan required -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -114,33 +114,19 @@ You can configure the order of MFA or enable/disable MFA type by passing the `mf -`deviceShareFactor` | `backUpShareFactor` | `socialBackupFactor` | `passwordFactor` - -| Parameter | Type | Mandatory | Description | -| ----------- | ------ | --------- | ---------------------- | -| `enable` | `Bool` | Yes | Enable/Disable MFA | -| `priority` | `Int?` | No | Priority of MFA | -| `mandatory` | `Bool?`| No | Mandatory/Optional MFA | +| Parameter | Description | +| --------------------- | ----------------------------------------------------------------------- | +| `deviceShareFactor?` | MFA setting for deviceShareFactor. It accepts `MfaSetting` as a value. | +| `backUpShareFactor?` | MFA setting for backUpShareFactor. It accepts `MfaSetting` as a value. | +| `socialBackupFactor?` | MFA setting for socialBackupFactor. It accepts `MfaSetting` as a value. | +| `passwordFactor?` | MFA setting for passwordFactor. It accepts `MfaSetting` as a value. | ```swift - - public struct MfaSetting: Codable { - public init(enable: Bool, priority: Int?, mandatory: Bool? = nil) { - self.enable = enable - self.priority = priority - self.mandatory = mandatory - } - - let enable: Bool - let priority: Int? - let mandatory: Bool? - } - - public struct MfaSettings: Codable { + public struct MfaSettings: Codable { public init(deviceShareFactor: MfaSetting?, backUpShareFactor: MfaSetting?, socialBackupFactor: MfaSetting?, passwordFactor: MfaSetting?) { self.deviceShareFactor = deviceShareFactor self.backUpShareFactor = backUpShareFactor @@ -153,7 +139,46 @@ You can configure the order of MFA or enable/disable MFA type by passing the `mf let socialBackupFactor: MfaSetting? let passwordFactor: MfaSetting? } +``` + + + +`MfaSettings` + + + + + +| Parameter | Description | +| ------------ | ------------------------------------------------------------------------------- | +| `enable` | Enable/Disable MFA. It accepts `Bool` as a value. | +| `priority?` | Priority of MFA. It accepts `Int` as a value, where valid range is from 1 to 4. | +| `mandatory?` | Mandatory/Optional MFA. It acccepts `Bool` as a value. | + + + + + +```swift + + public struct MfaSetting: Codable { + public init(enable: Bool, priority: Int?, mandatory: Bool? = nil) { + self.enable = enable + self.priority = priority + self.mandatory = mandatory + } + + let enable: Bool + let priority: Int? + let mandatory: Bool? + } ``` diff --git a/docs/sdk/pnp/ios/usage.mdx b/docs/sdk/pnp/ios/usage.mdx index af77eb764..4791026e6 100644 --- a/docs/sdk/pnp/ios/usage.mdx +++ b/docs/sdk/pnp/ios/usage.mdx @@ -32,15 +32,15 @@ the login method for specific social logins such as Google, Apple, Facebook, etc -| Parameter | Type | Mandatory | Description | -| ------------------- | --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `loginProvider` | `Web3AuthProvider` | No | Login provider, supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `GITHUB`, `LINKEDIN`, `TWITTER`, `WEIBO`, `LINE`, `EMAIL_PASSWORD`, `EMAIL_PASSWORDLESS`, `JWT` | -| `dappShare` | `String` | No | Dapp share can be used to pass dapp share url, default is `nil` | -| `extraLoginOptions` | `ExtraLoginOptions` | No | You can pass various OAuth-supported options, default is `nil` | -| `redirectUrl` | `String` | No | Url where user will be redirected after successfull login. By default user will be redirected to the same page where login will be initiated, the default is `nil` | -| `appState` | `String` | No | `appState` can be used to keep track of the app state when the user is redirected to the app after login, default is `nil` | -| `mfaLevel` | `MFALevel` | No | MFA level can be used to pass 2FA screen shown during login, default is `nil`, shown every 3rd login. | -| `curve` | `SUPPORTED_KEY_CURVES`| No | Curve can be used to pass curve options, `ED25519` for Solana and `SECP256K1` for Ethereum, default is `SECP256K1`. | +| Parameter | Description | +| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginProvider` | It sets the OAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | +| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding `loginProvider`. For instance, you'll need to pass user's email address as. Default value for the field is `nil`, and it accepts `ExtraLoginOptions` as a value. | +| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `nil`, and accepts `URL` as a value. | +| `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `nil`, and accepts `String` as a value. | +| `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MFALevel.DEFAULT`, which shows MFA screen every 3rd login. It accepts `MFALevel` as a value. | +| `dappShare?` | Custom verifier logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. It accepts `String` as a value. | +| `curve?` | It will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. This parameter won't change format of private key returned by We3Auth. Private key returned by `getPrivKey` is always secp256k1. To get the ed25519 key you can use `getEd25519PrivKey` method. The default value is `SUPPORTED_KEY_CURVES.SECP256K1`. | @@ -74,7 +74,8 @@ public struct W3ALoginParams: Codable { ### `getPrivkey()` -Use getPrivkey() to get the private key of the user. The method returns an EVM compatible private key which can be used to sign transactions on EVM compatible chains. +Use getPrivkey() to get the private key of the user. The method returns an EVM compatible private key which can be used to sign transactions on EVM +compatible chains. ### `getEd25519PrivKey()` @@ -218,82 +219,6 @@ login(provider: .JWT) ``` - - - -## ExtraLoginOptions - -### Arguments - -`ExtraLoginOptions` - -```swift -Web3Auth.login(W3ALoginParams( - provider = selectedLoginProvider, - extraLoginOptions = ExtraLoginOptions(login_hint: "hello@web3auth.io") -)) -``` - - - - - -| Parameter | Type | Mandatory | Description | -| --------------------------- | ------------------- | --------- | ---------------------------------------------------------------------- | -| `domain` | `String?` | No | Domain of the app | -| `client_id` | `String?` | No | client_id from Web3Auth Dashboard | -| `leeway` | `Int?` | No | The value in seconds used to account for clock skew in JWT expirations | -| `verifierIdField` | `String?` | No | The field in the jwt token that maps to the verifier id. | -| `isVerifierIdCaseSensitive` | `Bool?` | No | Whether the verifier id field is case sensitive | -| `display` | `Display?` | No | Display | -| `prompt` | `Prompt?` | No | Prompt | -| `max_age` | `String?` | No | max_age | -| `ui_locales` | `String?` | No | ui_locales to be shown on the modal | -| `id_token_hint` | `String?` | No | Previously issued ID Token. | -| `id_token` | `String?` | No | JWT (ID Token) to be passed for Login. | -| `login_hint` | `String?` | No | Email used for EMAIL_PASSWORDLESS | -| `acr_values` | `String?` | No | acc_values | -| `scope` | `String?` | No | scope | -| `audience` | `String?` | No | audience | -| `connection` | `String?` | No | connection | -| `redirect_uri` | `String?` | No | redirect_uri | -| `additionalParams` | `[String : String]?`| No | additonal parameters | - - - - - -```swift -public struct ExtraLoginOptions: Codable{ - let display: String? - let prompt: String? - let max_age: String? - let ui_locales: String? - let id_token_hint: String? - let id_token: String? - let login_hint: String? - let acr_values: String? - let scope: String? - let audience: String? - let connection: String? - let domain: String? - let client_id: String? - let redirect_uri: String? - let leeway: Int? - let verifierIdField: String? - let isVerifierIdCaseSensitive: Bool? - let additionalParams: [String : String]? -} -``` - - - ## Session Management diff --git a/docs/sdk/pnp/ios/whitelabel.mdx b/docs/sdk/pnp/ios/whitelabel.mdx index bbaba521c..f9980dd8d 100644 --- a/docs/sdk/pnp/ios/whitelabel.mdx +++ b/docs/sdk/pnp/ios/whitelabel.mdx @@ -8,12 +8,13 @@ description: "Web3Auth PnP iOS SDK - Whitelabel | Documentation - Web3Auth" import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; -For defining custom UI, branding, and translations for your brand app, you just need to define an optional object called `W3AWhiteLabelData`. `W3AWhiteLabelData` can be definied during initialization of the SDK in `W3AInitParams` object. +For defining custom UI, branding, and translations for your brand app, you just need to define an optional object called `W3AWhiteLabelData`. +`W3AWhiteLabelData` can be definied during initialization of the SDK in `W3AInitParams` object. :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -31,16 +32,16 @@ The parameters which can be used to customize the User Flow Screens are given be -| Parameter | Type | Description | Default | Mandatory | -| ----------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | --------- | -| `appName` | `String` | App name to be displayed in the User Flow Screens. | dApp's Website URL | No | -| `logoLight` | `String` | App logo to be shown on the dark background (dark theme). | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `logoDark` | `String` | App logo to be shown on the light background (light theme). | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `defaultLanguage` | `Language` | Default Language to use.
Choose from:
  • `en` - English
  • `de` - German
  • `ja` - Japanese
  • `ko` - Korean
  • `zh` - Mandarin
  • `es` - Spanish
  • `fr` - French
  • `pt` - Portuguese
  • `nl` - Dutch
| en - English | No | -| `mode` | `ThemeModes` | Choose between `auto`, `light` or `dark` modes. | `auto` | No | -| `theme` | `[String: String]` | Used to customize the theme of the login modal with the following options
`'primary'` - To customize the primary color of the modal's content | `#0364FF` | No | -| `appUrl` | `String` | App URL to be displayed in the User Flow Screens. | dApp's Website URL | No | -| `useLogoLoader` | `Bool` | Uses the logo for loading in the User Flow Screens. | false | No | +| Parameter | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `appName?` | Display name for the app in the UI. | +| `logoLight?` | App logo to be used in dark mode. It accepts url in `String` as a value. | +| `logoDark?` | App logo to be used in light mode. It accepts url in `String` as a value. | +| `defaultLanguage?` | Language which will be used by Web3Auth, app will use browser language if not specified. Default language is `Language.en`. Checkout `Language` for supported languages. | +| `mode?` | Theme mode for the login modal. Choose between `ThemeModes.auto`, `ThemeModes.light` or `ThemeModes.dark` background modes. Default value is `ThemeModes.AUTO`. | +| `theme?` | Used to customize the theme of the login modal. It accepts Dictonary of `[String:String]` as a value. | +| `appUrl?` | Url to be used in the Modal. It accepts url in `String` as a value. | +| `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are nil, the default Web3Auth logo will be used for the loader. Default value is false. |
From dd2766458819506fb609a577c035e876ff5dcdc7 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Mon, 11 Mar 2024 23:23:44 +0530 Subject: [PATCH 4/9] update docs for react-native --- .../react-native/custom-authentication.mdx | 64 +++--- docs/sdk/pnp/react-native/initialize.mdx | 24 ++- docs/sdk/pnp/react-native/usage.mdx | 192 +----------------- docs/sdk/pnp/react-native/whitelabel.mdx | 28 +-- 4 files changed, 74 insertions(+), 234 deletions(-) diff --git a/docs/sdk/pnp/react-native/custom-authentication.mdx b/docs/sdk/pnp/react-native/custom-authentication.mdx index 88993dd91..d3d394987 100644 --- a/docs/sdk/pnp/react-native/custom-authentication.mdx +++ b/docs/sdk/pnp/react-native/custom-authentication.mdx @@ -17,8 +17,8 @@ First, configure your own verifier in the Web3Auth Dashboard to use custom authe :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -52,22 +52,22 @@ Then, you should specify the details of your verifier in the value of the `Login -| Parameter | Type | Mandatory | Description | -| ----------------------- | ------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `verifier` | `String` | Yes | The name of the verifier that you have registered in Web3Auth Dashboard. | -| `typeOfLogin` | `enum TypeOfLogin` | Yes | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose google, a google sign-in flow will be used. If you choose jwt, which you should be providing your own JWT token, no sign-in flow will be presented. | -| `clientId` | `String` | Yes | The Client Id of the login provider. e.g. Google's Client ID | -| `name` | `String` | No | Name of your verifier. | -| `description` | `String` | No | Description of this login flow. | -| `verifierSubIdentifier` | `String` | No | The name of the field in the JWT that should be used as the unique user ID of the JWT. Should be same as the one you used in the verifier config. | -| `logoHover` | `String` | No | Logo to be shown on mouse hover. | -| `logoLight` | `String` | No | Logo to be shown on light background (light theme). | -| `logoDark` | `String` | No | Logo to be shown on dark background (dark theme). | -| `mainOption` | `Bool` | No | Show login button on the main list | -| `showOnModal` | `Bool` | No | Whether to show the login button on modal or not | -| `showOnDesktop` | `Bool` | No | Whether to show the login button on desktop | -| `showOnMobile` | `Bool` | No | Whether to show the login button on mobile | -| `jwtParameters` | `JwtParameters` | No | Extra jwt parameters to be passed. | +| Parameter | Description | +| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `string` as a value. | +| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `TypeOfLogin` as a value. | +| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `string` as a value. | +| `name?` | Display name for the verifier. If null, the default name is used. It accepts `string` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `string` as a value. | +| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `string` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `string` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `string` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `string` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `oolean` as a value. Default value is false. | +| `showOnModal?` | Whether to show the login button on modal or not. Default value is true. | +| `showOnDesktop?` | Whether to show the login button on desktop. Default value is true. | +| `showOnMobile?` | Whether to show the login button on mobile. Default value is true. | +| `jwtParameters` | Custom jwt parameters to configure the login. Useful for Auth0 configuration. It accepts `JwtParameters` as a value. | @@ -283,14 +283,26 @@ for enabling login. The `ExtraLoginOptions` accepts the following parameters: -| Parameter | Type | Description | -| --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| `domain` | `string` | Your Auth0 account domain such as `example.auth0.com` or `example.mycompany.com` etc. **Use any random string in case of custom JWT login.** | -| `client_id` | `string` | The Client ID found on your Auth0 Application settings page. **Use web3auth client id in case of custom JWT login.** | -| `redirect_uri` | `string` | The default URL where Auth0 will redirect your browser to with the authentication result. | -| `leeway` | `number` | The value in seconds used to account for clock skew in JWT expirations. | -| `verifierIdField` | `string` | The field in jwt token which maps to verifier id. | -| `isVerifierIdCaseSensitive` | `boolean` | Whether the verifier id field is case sensitive. Defaults to `true` | +| Parameter | Description | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalParams?` | Additional params in `[key: string]` format for OAuth login, use id_token(JWT) to authenticate with web3auth. | +| `domain?` | Your custom authentication domain in `string` format. For example, if you are using Auth0, it can be example.au.auth0.com. | +| `client_id?` | Client id in `string` format, provided by your login provider used for custom verifier. | +| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `string` as a value. | +| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `string` as a value. | +| `isVerifierIdCaseSensitive?` | `boolean` to confirm Whether the verifier id field is case sensitive or not. | +| `display?` | Allows developers the configure the display of UI. It takes `string` as a value. | +| `prompt?` | Prompt shown to the user during authentication process. It takes `string` as a value. | +| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `string` as a value. | +| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. | +| `id_token_hint?` | It denotes the previously issued ID token. It takes `string` as a value. | +| `id_token?` | JWT (ID Token) to be passed for login. | +| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `string` as a value. | +| `acr_values?` | acc_values | +| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `string` as a value. | +| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `string` as a value. | +| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `string` as a value. | +| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. | diff --git a/docs/sdk/pnp/react-native/initialize.mdx b/docs/sdk/pnp/react-native/initialize.mdx index bf6e6e1ca..9cb835684 100644 --- a/docs/sdk/pnp/react-native/initialize.mdx +++ b/docs/sdk/pnp/react-native/initialize.mdx @@ -129,17 +129,19 @@ below. -| Parameter | Type | Mandatory | Description | -| ------------- | ----------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| clientId | String | Yes | Your Web3Auth project ID obtained from the Web3Auth dashboard | -| network | Choose between `sapphire_mainnet`, `sapphire_testnet` | Yes | Web3Auth network to run on, either `sapphire_mainnet` or `sapphire_testnet` | -| redirectUrl | String | No | The redirectUrl that the Web3Auth login flow will use to redirect back to the app. | -| loginConfig | LoginConfig | No | A configuration optional object to customize login flow. | -| whiteLabel | WhiteLabelData | No | A configuration optional object to customize UI, branding, and translations for your brand. Refer to the WhiteLabeling section for more info. | -| sessionTime | Any number from 1 to 86400\*7. Default is 86400 | No | Decides how long should a login session last in seconds | -| mfaSettings | MfaSettings | No | This parameter will be used to enable mfa factors and set priority on UI listing. List of factors available
  • backUpShareFactor
  • socialFactor
  • passwordFactor
  • deviceShareFactor
| -| useCoreKitKey | boolean | No | Use `useCoreKitKey` as `true`, if you're using this SDK with the Single Factor Auth Web SDK | -| sdkUrl | String | No | The url to the SDK frontend, should not need any changes normally. | +| Parameter | Description | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `string` | +| `network` | Defines the Web3Auth network. It's a mandatory field of type `OPENLOGIN_NETWORK_TYPE`. | +| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `string`. | +| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | +| `loginConfig?` | Login config for the custom verifiers. It takes `LoginConfig` as a value. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `MfaSettings` as a value. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | +| `storageServerUrl` | Specify a custom storage url. Default value is `https://broadcast-server.tor.us`. | +| `storageKey` | Specify the storage key. Setting to "local" will persist social login session accross browser tabs. Available options are "local" and "session". | +| `useMpc` | Whether to use openlogin MPC or not. Default value is `false`. |
diff --git a/docs/sdk/pnp/react-native/usage.mdx b/docs/sdk/pnp/react-native/usage.mdx index 4da98189b..4f5170791 100644 --- a/docs/sdk/pnp/react-native/usage.mdx +++ b/docs/sdk/pnp/react-native/usage.mdx @@ -39,15 +39,15 @@ Trigger the login flow that navigates the user to a browser model that allows th -| Parameter | Type | Mandatory | Description | -| ------------------- | --------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `loginProvider` | `LOGIN_PROVIDER_TYPE` or `string` | Yes | Login provider to be used, will show a web-based page allowing user to pick their own loginProvider if not specified. supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`, `JWT` | -| `redirectUrl` | `string` | Yes | The redirectUrl that the Web3Auth login flow will use to redirect back to the app. Setting `redirectUrl` here can override the settings in `SdkInitParams`. | -| `appState` | `string` | No | Any custom state you wish to pass along. This will be returned to you post-redirect. Use this to store data that you want to be available to the dapp after login. | -| `mfaLevel` | `MfaLevelType` | No | You can set the `mfaLevel` to customize when mfa screen should be shown to the user. | -| `dappShare` | `string` | No | Custom Logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to log in seamlessly dappShare is a 24-word seed phrase | -| `extraLoginOptions` | `ExtraLoginOptions` | No | can be used to pass standard oauth login options to loginProvider | -| `curve` | `Map` | No | Curve can be used to pass curve options, `ED25519` for Solana and `SECP256K1` for Ethereum | +| Parameter | Description | +| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `loginProvider` | It sets the OAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | +| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding `loginProvider`. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `ExtraLoginOptions` as a value. | +| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null`, and accepts `Uri` as a value. | +| `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `null`, and accepts `string` as a value. | +| `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MfaLevelType.default`, which shows MFA screen every 3rd login. It accepts `MfaLevelType` as a value. | +| `dappShare?` | Custom verifier logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. It accepts `string` as a value. | +| `curve?` | It will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. This parameter won't change format of private key returned by We3Auth. Private key returned by `getPrivKey` is always secp256k1. To get the ed25519 key you can use `ed25519Key` method. The default value is `SUPPORTED_KEY_CURVES_TYPE.secp256k1`. | @@ -156,180 +156,6 @@ await web3auth.login({ }); ``` -### `ExtraLoginOptions` for special login methods - -You can pass extra options to the `login` function to configure the login flow for cases requiring additional info for enabling login. The -`ExtraLoginOptions` accepts the following parameters: - - - - - -| Parameter | Type | Mandatory | Description | -| --------------------------- | ---------- | --------- | ----------------------------------------------------- | -| `domain` | `String?` | No | Domain of the app | -| `client_id` | `String?` | No | client_id from Web3Auth Dashboard | -| `leeway` | `String?` | No | leeway | -| `verifierIdField` | `String?` | No | verifierIdField | -| `isVerifierIdCaseSensitive` | `Boolean?` | No | Boolean to confirm the case sensitivity of VerifierId | -| `display` | `Display?` | No | Display | -| `prompt` | `Prompt?` | No | Prompt | -| `max_age` | `String?` | No | max_age | -| `ui_locales` | `String?` | No | ui_locales to be shown on the modal | -| `id_token` | `String?` | No | JWT token passed to authenticate with web3auth | -| `login_hint` | `String?` | No | Email used for EMAIL_PASSWORDLESS | -| `acr_values` | `String?` | No | acc_values | -| `scope` | `String?` | No | scope | -| `audience` | `String?` | No | audience | -| `connection` | `String?` | No | connection | -| `redirect_uri` | `String?` | No | redirect_uri | - - - - - -```typescript -export interface BaseLoginOptions { - /** - * If you need to send custom parameters to the Authorization Server, - * make sure to use the original parameter name. - */ - [key: string]: unknown; - /** - * - `'page'`: displays the UI with a full page view - * - `'popup'`: displays the UI with a popup window - * - `'touch'`: displays the UI in a way that leverages a touch interface - * - `'wap'`: displays the UI with a "feature phone" type interface - */ - display?: "page" | "popup" | "touch" | "wap" | string; - /** - * - `'none'`: do not prompt user for login or consent on re-authentication - * - `'login'`: prompt user for re-authentication - * - `'consent'`: prompt user for consent before processing request - * - `'select_account'`: prompt user to select an account - */ - prompt?: "none" | "login" | "consent" | "select_account" | string; - /** - * Maximum allowable elapsed time (in seconds) since authentication. - * If the last time the user authenticated is greater than this value, - * the user must be re-authenticated. - */ - max_age?: string | number; - /** - * The space-separated list of language tags, ordered by preference. - * For example: `'fr-CA fr en'`. - */ - ui_locales?: string; - /** - * Previously issued ID Token. - */ - id_token_hint?: string; - /** - * The user's email address or other identifier. When your app knows - * which user is trying to authenticate, you can provide this parameter - * to pre-fill the email box or select the right session for sign-in. - * - * This currently only affects the classic Lock experience. - */ - login_hint?: string; - id_token?: string; - acr_values?: string; - /** - * The default scope to be used on authentication requests. - * The defaultScope defined in the Auth0Client is included - * along with this scope - */ - scope?: string; - /** - * The default audience to be used for requesting API access. - */ - audience?: string; - /** - * The name of the connection configured for your application. - * If null, it will redirect to the Auth0 Login Page and show - * the Login Widget. - */ - connection?: string; -} - -export interface ExtraLoginOptions extends BaseLoginOptions { - /** - * Your Auth0 account domain such as `'example.auth0.com'`, - * `'example.eu.auth0.com'` or , `'example.mycompany.com'` - * (when using [custom domains](https://auth0.com/docs/custom-domains)) - */ - domain?: string; - /** - * The Client ID found on your Application settings page - */ - client_id?: string; - /** - * The default URL where Auth0 will redirect your browser to with - * the authentication result. It must be whitelisted in - * the "Allowed Callback URLs" field in your Auth0 Application's - * settings. If not provided here, it should be provided in the other - * methods that provide authentication. - */ - redirect_uri?: string; - /** - * The value in seconds used to account for clock skew in JWT expirations. - * Typically, this value is no more than a minute or two at maximum. - * Defaults to 60s. - */ - leeway?: number; - /** - * The field in jwt token which maps to verifier id - */ - verifierIdField?: string; - /** - * Whether the verifier id field is case sensitive - * @defaultValue true - */ - isVerifierIdCaseSensitive?: boolean; -} -``` - - - - - -### Email Passwordless - -To use the `EMAIL_PASSWORDLESS` login, you need to put the email into the `login_hint` field of the `extraLoginOptions`. - -```tsx -web3auth.login({ - loginProvider: LoginProvider.EMAIL_PASSWORDLESS, - redirectUrl: resolvedRedirectUrl, - //highlight-start - extraLoginOptions: { - login_hint: "hello@web3auth.io", - }, - //highlight-end -}); -``` - -#### Example (Custom Authentication) - -```tsx -web3auth.login({ - loginProvider: LoginProvider.JWT, - redirectUrl: resolvedRedirectUrl, // redirect url after login - //highlight-start - extraLoginOptions: { - id_token: "your JWT id token", - verifierIdField: "sub", // auth0 generally uses sub as unique identifier - }, - //highlight-end -}); -``` - ### Selecting Curve The `web3auth.login()` method accepts a `curve` parameter. This parameter can be used to select the elliptic curve to use for the signature. diff --git a/docs/sdk/pnp/react-native/whitelabel.mdx b/docs/sdk/pnp/react-native/whitelabel.mdx index b1bfb4529..1a2792dea 100644 --- a/docs/sdk/pnp/react-native/whitelabel.mdx +++ b/docs/sdk/pnp/react-native/whitelabel.mdx @@ -14,8 +14,8 @@ For defining custom UI, branding, and translations for your brand app, you just :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -33,18 +33,18 @@ This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricin -| Parameter | Type | Mandatory | Description | -| ----------------- | --------- | --------- | --------------------------------------- | -| `appName` | `String` | No | Name of your application | -| `appUrl` | `String` | No | URL of your application | -| `logoLight` | `String` | No | Light logo for dark background | -| `logoDark` | `String` | No | Dark logo for light background | -| `defaultLanguage` | `String` | No | Default translation language to be used | -| `mode` | `String` | No | Theme mode to be used | -| `useLogoLoader` | `Boolean` | No | Use logo loader | -| `theme` | `Object` | No | Whitelabel theme | -| `tncLink` | `String` | No | Terms and conditions link | -| `privacyPolicy` | `String` | No | Privacy policy link | +| Parameter | Description | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `appName?` | Display name for the app in the UI. | +| `logoLight?` | App logo to be used in dark mode. It accepts url in `string` as a value. | +| `logoDark?` | App logo to be used in light mode. It accepts url in `string` as a value. | +| `defaultLanguage?` | Language which will be used by Web3Auth, app will use browser language if not specified. Default language is `LANGUAGE_TYPE.en`. Checkout `LANGUAGE_TYPE` for supported languages. | +| `mode?` | Theme mode for the login modal. Choose between `THEME_MODE_TYPE.auto`, `THEME_MODE_TYPE.light` or `THEME_MODE_TYPE.dark` background modes. Default value is `ThemeModes.auto`. | +| `theme?` | Used to customize the theme of the login modal. It accepts `Record` as a value. | +| `appUrl?` | Url to be used in the Modal. It accepts url in `string` as a value. | +| `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are null, the default Web3Auth logo will be used for the loader. Default value is false. | +| `tncLink` | Terms and conditions link in `Partial>`. | +| `privacyPolicy` | Privacy policy link in `Partial>`. | From 8281524bc97785615f2a306d4b7ab200f87c67f4 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Tue, 12 Mar 2024 10:11:42 +0530 Subject: [PATCH 5/9] improve pnp docs --- docs/sdk/pnp/react-native/usage.mdx | 2 +- docs/sdk/pnp/unity/custom-authentication.mdx | 34 +++++----- docs/sdk/pnp/unity/initialize.mdx | 20 +++--- docs/sdk/pnp/unity/usage.mdx | 65 ++++++++++--------- docs/sdk/pnp/unity/whitelabel.mdx | 24 +++---- docs/sdk/pnp/unreal/custom-authentication.mdx | 34 +++++----- docs/sdk/pnp/unreal/initialize.mdx | 22 +++---- docs/sdk/pnp/unreal/usage.mdx | 61 ++++++++--------- docs/sdk/pnp/unreal/whitelabel.mdx | 24 +++---- docs/sdk/pnp/web/wagmi-connector.mdx | 10 +-- src/common/sdk/pnp/web/_add-chain.mdx | 6 +- src/common/sdk/pnp/web/_chain-config.mdx | 28 ++++---- src/common/sdk/pnp/web/_connect-to.mdx | 10 +-- .../sdk/pnp/web/_extra-login-options.mdx | 34 ++++++---- src/common/sdk/pnp/web/_login-config.mdx | 34 +++++----- src/common/sdk/pnp/web/_modal-config.mdx | 40 ++++++------ .../pnp/web/_openlogin-adapter-settings.mdx | 22 +++---- .../sdk/pnp/web/_openlogin-login-params.mdx | 25 ++++--- .../sdk/pnp/web/_openlogin-login-settings.mdx | 24 +++---- .../pnp/web/_openlogin-whitelabel-config.mdx | 22 +++---- src/common/sdk/pnp/web/_plugin-config.mdx | 26 ++++---- .../sdk/pnp/web/_plugin-whitelabel-config.mdx | 38 +++++------ src/common/sdk/pnp/web/_switch-chain.mdx | 6 +- src/common/sdk/pnp/web/_ui-config.mdx | 14 ++-- src/common/sdk/pnp/web/_web3auth-options.mdx | 30 ++++----- .../sdk/pnp/web/_web3authcore-options.mdx | 22 +++---- 26 files changed, 341 insertions(+), 336 deletions(-) diff --git a/docs/sdk/pnp/react-native/usage.mdx b/docs/sdk/pnp/react-native/usage.mdx index 4f5170791..bcb9f2174 100644 --- a/docs/sdk/pnp/react-native/usage.mdx +++ b/docs/sdk/pnp/react-native/usage.mdx @@ -43,7 +43,7 @@ Trigger the login flow that navigates the user to a browser model that allows th | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `loginProvider` | It sets the OAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | | `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding `loginProvider`. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `ExtraLoginOptions` as a value. | -| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null`, and accepts `Uri` as a value. | +| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null`, and accepts `string` as a value. | | `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `null`, and accepts `string` as a value. | | `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MfaLevelType.default`, which shows MFA screen every 3rd login. It accepts `MfaLevelType` as a value. | | `dappShare?` | Custom verifier logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. It accepts `string` as a value. | diff --git a/docs/sdk/pnp/unity/custom-authentication.mdx b/docs/sdk/pnp/unity/custom-authentication.mdx index e9bf862d0..1390414f2 100644 --- a/docs/sdk/pnp/unity/custom-authentication.mdx +++ b/docs/sdk/pnp/unity/custom-authentication.mdx @@ -27,8 +27,8 @@ Then, you should specify the details of your verifier in the `LoginConfigItem` s :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -46,21 +46,21 @@ This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricin -| Parameter | Type | Mandatory | Description | -| --------------------- | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| verifier | String | Yes | The name of the verifier which you have registered on the Web3Auth Dashboard. | -| typeOfLogin | Enum`` | Yes | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose google, a google sign-in flow will be used. If you choose jwt, which you should be providing your own JWT token, no sign-in flow will be presented. | -| name | String | No | Name of your verifier for display purpose. | -| description | String? | No | Description of this login flow. | -| clientId | String? | No | The Client Id of the login provider. e.g. Google's Client ID | -| verifierSubIdentifier | String? | No | The name of the field in the JWT that should be used as the unique user ID of the JWT. Should be same as the one you used | -| logoHover | String? | No | Logo to be shown on mouse hover. | -| logoLight | String? | No | Light logo for dark background | -| logoDark | String? | No | Dark logo for light background | -| mainOption | Boolean? | No | Show login button on the main list | -| showOnModal | Boolean? | No | Whether to show the login button on modal or not | -| showOnDesktop | Boolean? | No | Whether to show the login button on desktop | -| showOnMobile | Boolean? | No | Whether to show the login button on mobile | +| Parameter | Description | +| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `string` as a value. | +| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `TypeOfLogin` as a value. | +| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `string` as a value. | +| `name?` | Display name for the verifier. If null, the default name is used. It accepts `string` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `string` as a value. | +| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `string` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `string` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `string` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `string` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `bool` as a value. Default value is false. | +| `showOnModal?` | Whether to show the login button on modal or not. Default value is true. | +| `showOnDesktop?` | Whether to show the login button on desktop. Default value is true. | +| `showOnMobile?` | Whether to show the login button on mobile. Default value is true. | diff --git a/docs/sdk/pnp/unity/initialize.mdx b/docs/sdk/pnp/unity/initialize.mdx index da03e2e49..f2f2e8818 100644 --- a/docs/sdk/pnp/unity/initialize.mdx +++ b/docs/sdk/pnp/unity/initialize.mdx @@ -88,16 +88,16 @@ The Web3Auth Constructor takes a class `Web3AuthOptions` as input. This class ha -| Parameter | Type | Mandatory | Description | -| ---------------- | ------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientId` | `string` | Yes | Your Web3Auth Project ID | -| `network` | enum Web3Auth.Network | Yes | Network to run Web3Auth, either SAPPHIRE_MAINNET, SAPPHIRE_DEVNET, MAINNET, CYAN, AQUA or TESTNET | -| `redirectUrl` | `Uri` | No | URL that Web3Auth will redirect API responses, default is `null` | -| `whiteLabel` | `WhiteLabelData` | No | A configuration optional object to customize UI, branding, and translations for your brand. Refer [WhiteLabel](/pnp/features/whitelabel) section for more info. | -| `loginConfig` | `Dictionary` | No | A configuration optional object to use custom authentication. Refer [Custom Authentication](/pnp/features/custom-authentication) for more info. | -| `useCoreKitKey` | `bool` | No | A configuration optional object to use coreKitKey. | -| `chainNamespace` | `ChainNamespace` | No | A configuration optional object to use chainNamespace. | -| `mfaSettings` | `MfaSettings` | No | A configuration optional object to use mfaSettings. | +| Parameter | Description | +| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `string` | +| `network` | Defines the Web3Auth network. It's a mandatory field of type Network. | +| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `Uri`. | +| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | +| `loginConfig?` | Login config for the custom verifiers. It takes `Dictionary` as a value. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `chainNamespace?` | Chain Namespace [`EIP155` and `SOLANA`]. It takes `Web3Auth.ChainNamespace` as a value. | +| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `MfaSettings` as a value. | diff --git a/docs/sdk/pnp/unity/usage.mdx b/docs/sdk/pnp/unity/usage.mdx index 0a6250c3b..800ca7d6e 100644 --- a/docs/sdk/pnp/unity/usage.mdx +++ b/docs/sdk/pnp/unity/usage.mdx @@ -59,16 +59,16 @@ private void onLogin(Web3AuthResponse response) -| Parameter | Type | Mandatory | Description | -| ------------------- | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `loginProvider` | `enum` `Provider` | Yes | Login provider, supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`, `JWT` | -| `dappShare` | `string` | No | Dapp share can be used to pass dapp share url, default is `null` | -| `extraLoginOptions` | `ExtraLoginOptions` | No | You can pass various oauth supported options, default is `null` | -| `redirectUrl` | `Uri` | No | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated, default is `null` | -| `appState` | `string` | No | appState can be used to keep track of the app state when user will be redirected to app after login, default is `null` | -| `mfaLevel` | `MFALevel` | No | MFA level can be used to pass 2FA screen shown during login, default is `mfaLevel.DEFAULT`, shown every 3rd login. | -| `sessionTime` | `int` | No | Set the maximum session time before next login | -| `curve` | `Curve` | No | Curve can be used to pass curve options, `ED25519` for Solana and `SECP256K1` for Ethereum | +| Parameter | Description | +| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginProvider` | It sets the OAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | +| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding `loginProvider`. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `ExtraLoginOptions` as a value. | +| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null`, and accepts `Uri` as a value. | +| `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `null`, and accepts `string` as a value. | +| `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MFALevel.DEFAULT`, which shows MFA screen every 3rd login. It accepts `MFALevel` as a value. | +| `dappShare?` | Custom verifier logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. It accepts `string` as a value. | +| `curve?` | It will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. This parameter won't change format of private key returned by We3Auth. Private key returned by `getPrivKey` is always secp256k1. The default value is `Curve.SECP256K1`. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, and takes `int` as a value. | @@ -153,28 +153,29 @@ LoginParams() { selectedLoginProvider, extraLoginOptions = ExtraLoginOptions() } -| Parameter | Type | Mandatory | Description | -| ------------------------- | ---------------------------- | --------- | ----------------------------------------------------- | -| additionalParams | `Dictionary` | No | additionalParams | -| domain | `string` | No | Domain of the app | -| client_id | `string` | No | client_id from Web3Auth Dashboard | -| leeway | `string` | No | leeway | -| verifierIdField | `string` | No | verifierIdField | -| isVerifierIdCaseSensitive | `bool` | No | Boolean to confirm the case sensitivity of VerifierId | -| display | `Display` | No | Display | -| prompt | `Prompt` | No | Prompt | -| max_age | `string` | No | max_age | -| ui_locales | `string` | No | ui_locales to be shown on the modal | -| id_token | `string` | No | JWT token passed to authenticate with web3auth | -| login_hint | `string` | No | Email used for EMAIL_PASSWORDLESS | -| acr_values | `string` | No | acc_values | -| scope | `string` | No | scope | -| audience | `string` | No | audience | -| connection | `string` | No | connection | -| state | `string` | No | state | -| response_type | `string` | No | response_type | -| nonce | `string` | No | nonce | -| redirect_uri | `string` | No | redirect_uri | +| Parameter | Description | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalParams?` | Additional params in `Dictionary` format for OAuth login, use id_token(JWT) to authenticate with web3auth. | +| `domain?` | Your custom authentication domain in `string` format. For example, if you are using Auth0, it can be example.au.auth0.com. | +| `client_id?` | Client id in `string` format, provided by your login provider used for custom verifier. | +| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `string` as a value. | +| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `string` as a value. | +| `isVerifierIdCaseSensitive?` | `bool` to confirm Whether the verifier id field is case sensitive or not. | +| `display?` | Allows developers the configure the display of UI. It takes `Display` as a value. | +| `prompt?` | Prompt shown to the user during authentication process. It takes `Prompt` as a value. | +| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `string` as a value. | +| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. | +| `id_token_hint?` | It denotes the previously issued ID token. It takes `string` as a value. | +| `id_token?` | JWT (ID Token) to be passed for login. | +| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `string` as a value. | +| `acr_values?` | acc_values | +| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `string` as a value. | +| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `string` as a value. | +| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `string` as a value. | +| `state?` | state | +| `response_type?` | Defines which grant to execute for the authorization server. It takes `string` as a value. | +| `nonce?` | nonce | +| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. | diff --git a/docs/sdk/pnp/unity/whitelabel.mdx b/docs/sdk/pnp/unity/whitelabel.mdx index e9a7be450..50536a2db 100644 --- a/docs/sdk/pnp/unity/whitelabel.mdx +++ b/docs/sdk/pnp/unity/whitelabel.mdx @@ -13,8 +13,8 @@ class called `whiteLabel`. This parameter takes another object called `WhiteLabe :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -32,16 +32,16 @@ This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricin -| Parameter | Type | Mandatory | Description | -| ----------------- | ----------------------------- | --------- | --------------------------------------------------- | -| `appName` | `String` | No | Name of your application | -| `appUrl` | `String` | No | URL of your application | -| `logoLight` | `String` | No | Light logo for dark background | -| `logoDark` | `String` | No | Dark logo for light background | -| `useLogoLoader` | `Boolean` | No | Use logo as loader, default is false. | -| `defaultLanguage` | `Web3Auth.Language?` | No | Translation language to be used, default is English | -| `mode` | `Web3Auth.ThemeModes?` | No | `light`, `dark` or `auto`. Defualt is `auto` | -| `theme` | `Dictionary?` | No | Whitelabel theme | +| Parameter | Description | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `appName?` | Display name for the app in the UI. | +| `logoLight?` | App logo to be used in dark mode. It accepts url in `string` as a value. | +| `logoDark?` | App logo to be used in light mode. It accepts url in `string` as a value. | +| `defaultLanguage?` | Language which will be used by Web3Auth, app will use browser language if not specified. Default language is `Web3Auth.Language.en`. Checkout `Web3Auth.Language` for supported languages. | +| `mode?` | Theme mode for the login modal. Choose between `Web3Auth.ThemeModes.auto`, `Web3Auth.ThemeModes.light` or `Web3Auth.ThemeModes.dark` background modes. Default value is `Web3Auth.ThemeModes.light`. | +| `theme?` | Used to customize the theme of the login modal. It accepts ` Dictionary` as a value. | +| `appUrl?` | Url to be used in the Modal. It accepts url in `string` as a value. | +| `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are null, the default Web3Auth logo will be used for the loader. Default value is false. | diff --git a/docs/sdk/pnp/unreal/custom-authentication.mdx b/docs/sdk/pnp/unreal/custom-authentication.mdx index 6abd495cb..d9bcaedba 100644 --- a/docs/sdk/pnp/unreal/custom-authentication.mdx +++ b/docs/sdk/pnp/unreal/custom-authentication.mdx @@ -19,8 +19,8 @@ First, configure your own verifier in the Web3Auth Dashboard to use custom authe :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -46,21 +46,21 @@ Then, you should specify the details of your verifier in the `LoginConfigItem` s -| Parameter | Type | Mandatory | Description | -| --------------------- | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| verifier | String | Yes | The name of the verifier which you have registered on the Web3Auth Dashboard. | -| typeOfLogin | Enum`` | Yes | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose google, a google sign-in flow will be used. If you choose jwt, which you should be providing your own JWT token, no sign-in flow will be presented. | -| name | String | No | Name of your verifier for display purpose. | -| description | String? | No | Description of this login flow. | -| clientId | String? | No | The Client Id of the login provider. e.g. Google's Client ID | -| verifierSubIdentifier | String? | No | The name of the field in the JWT that should be used as the unique user ID of the JWT. Should be same as the one you used | -| logoHover | String? | No | Logo to be shown on mouse hover. | -| logoLight | String? | No | Light logo for dark background | -| logoDark | String? | No | Dark logo for light background | -| mainOption | Boolean? | No | Show login button on the main list | -| showOnModal | Boolean? | No | Whether to show the login button on modal or not | -| showOnDesktop | Boolean? | No | Whether to show the login button on desktop | -| showOnMobile | Boolean? | No | Whether to show the login button on mobile | +| Parameter | Description | +| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `FString` as a value. | +| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `FTypeOfLogin` as a value. | +| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `FString` as a value. | +| `name?` | Display name for the verifier. If null, the default name is used. It accepts `FString` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `FString` as a value. | +| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `FString` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `FString` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `FString` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `FString` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `bool` as a value. Default value is false. | +| `showOnModal?` | Whether to show the login button on modal or not. Default value is true. | +| `showOnDesktop?` | Whether to show the login button on desktop. Default value is true. | +| `showOnMobile?` | Whether to show the login button on mobile. Default value is true. | diff --git a/docs/sdk/pnp/unreal/initialize.mdx b/docs/sdk/pnp/unreal/initialize.mdx index c8f6e7e20..b2c3ca4ad 100644 --- a/docs/sdk/pnp/unreal/initialize.mdx +++ b/docs/sdk/pnp/unreal/initialize.mdx @@ -33,17 +33,17 @@ The Web3Auth Constructor takes a class `Web3AuthOptions` as input. This class ha -| Parameter | Type | Mandatory | Description | -| ---------------- | --------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| `clientId` | `string` | Yes | The Client ID of your Web3Auth Application. | -| `redirectUrl` | `string` | Yes | The Redirect URL of your Web3Auth Application. | -| `network` | `FNetwork` | No | The Network of your Web3Auth Application. Defaults to `FNetwork::Mainnet`. MAINNET, TESTNET, CYAN, AQUA, SAPPHIRE_DEVNET, SAPPHIRE_MAINNET | -| `whiteLabel` | `FWhiteLabelData` | No | The White Label Data of your Web3Auth Application. | -| `loginConfig` | `TMap` | No | The Login Config of your Web3Auth Application. | -| `chainNamespace` | `FChainNamespace` | No | The Chain Namespace of your Web3Auth Application. | -| `useCoreKitKey` | `bool` | No | Whether to use CoreKit Key for authentication. | -| `mfaSettings` | `FMfaSettings` | No | The MFA Settings of your Web3Auth Application. | -| `sessionTime` | `int` | No | The Session Time of your Web3Auth Application. | +| Parameter | Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `FString` | +| `network` | Defines the Web3Auth network. It's a mandatory field of type Network. | +| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `FString`. | +| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `FWhiteLabelData` as a value. | +| `loginConfig?` | Login config for the custom verifiers. It takes `TMap` as a value. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `chainNamespace?` | Chain Namespace [`EIP155` and `SOLANA`]. It takes `FChainNamespace` as a value. | +| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `FMfaSettings` as a value. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | diff --git a/docs/sdk/pnp/unreal/usage.mdx b/docs/sdk/pnp/unreal/usage.mdx index 6bd300028..55cc0b33b 100644 --- a/docs/sdk/pnp/unreal/usage.mdx +++ b/docs/sdk/pnp/unreal/usage.mdx @@ -35,15 +35,15 @@ selected providers in the [provider](#provider) section. -| Parameter | Type | Mandatory | Description | -| ------------------- | ------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `loginProvider` | `enum` `Provider` | Yes | Login provider, supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`, `EMAIL_PASSWORD`, `JWT` | -| `dappShare` | `string` | No | Dapp share can be used to pass dapp share url, default is `null` | -| `extraLoginOptions` | `ExtraLoginOptions` | No | You can pass various OAuth supported options, default is `null` | -| `redirectUrl` | `Uri` | No | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated, default is `null` | -| `appState` | `string` | No | appState can be used to keep track of the app state when user will be redirected to app after login, default is `null` | -| `mfaLevel` | `MFALevel` | No | MFA level can be used to pass 2FA screen shown during login, default is `mfaLevel.DEFAULT`, shown every 3rd login. | -| `curve` | `Curve` | No | Curve can be used to pass curve options, `ED25519` for Solana and `SECP256K1` for Ethereum | +| Parameter | Description | +| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginProvider` | It sets the OAuth login method to be used. You can use any of the supported values are `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`. | +| `extraLoginOptions?` | It can be used to set the OAuth login options for corresponding `loginProvider`. For instance, you'll need to pass user's email address as. Default value for the field is `null`, and it accepts `FExtraLoginOptions` as a value. | +| `redirectUrl?` | Url where user will be redirected after successfull login. By default user will be redirected to same page where login will be initiated. Default value for the field is `null`, and accepts `FString` as a value. | +| `appState?` | It can be used to keep track of the app state when user will be redirected to app after login. Default is `null`, and accepts `FString` as a value. | +| `mfaLevel?` | Customize the MFA screen shown to the user during OAuth authentication. Default value for field is `MFALevel.DEFAULT`, which shows MFA screen every 3rd login. It accepts `FMFALevel` as a value. | +| `dappShare?` | Custom verifier logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. It accepts `FString` as a value. | +| `curve?` | It will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. The default value is `FCurve::speck256k1`. | @@ -145,27 +145,28 @@ passwordless login etc. This parameter can be considered as advanced login optio -| Parameter | Type | Mandatory | Description | -| ------------------------- | --------- | --------- | ----------------------------------------------------- | -| domain | `string` | No | Domain of the app | -| client_id | `string` | No | client_id from Web3Auth Dashboard | -| leeway | `string` | No | leeway | -| verifierIdField | `string` | No | verifierIdField | -| isVerifierIdCaseSensitive | `bool` | No | Boolean to confirm the case sensitivity of VerifierId | -| display | `Display` | No | Display | -| prompt | `Prompt` | No | Prompt | -| max_age | `string` | No | max_age | -| ui_locales | `string` | No | ui_locales to be shown on the modal | -| id_token_hint | `string` | No | ID Token hint | -| login_hint | `string` | No | Email used for EMAIL_PASSWORDLESS | -| acr_values | `string` | No | acc_values | -| scope | `string` | No | scope | -| audience | `string` | No | audience | -| connection | `string` | No | connection | -| state | `string` | No | state | -| response_type | `string` | No | response_type | -| nonce | `string` | No | nonce | -| redirect_uri | `string` | No | redirect_uri | +| Parameter | Description | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domain?` | Your custom authentication domain in `FString` format. For example, if you are using Auth0, it can be example.au.auth0.com. | +| `client_id?` | Client id in `FString` format, provided by your login provider used for custom verifier. | +| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `FString` as a value. | +| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `FString` as a value. | +| `isVerifierIdCaseSensitive?` | Boolean to confirm Whether the verifier id field is case sensitive or not. | +| `display?` | Allows developers the configure the display of UI. It takes `FDisplay` as a value. | +| `prompt?` | Prompt shown to the user during authentication process. It takes `FPrompt` as a value. | +| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `FString` as a value. | +| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. | +| `id_token_hint?` | It denotes the previously issued ID token. It takes `FString` as a value. | +| `id_token?` | JWT (ID Token) to be passed for login. | +| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `FString` as a value. | +| `acr_values?` | acc_values | +| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `FString` as a value. | +| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `FString` as a value. | +| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `FString` as a value. | +| `state?` | state | +| `response_type?` | Defines which grant to execute for the authorization server. It takes `FString` as a value. | +| `nonce?` | nonce | +| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. | diff --git a/docs/sdk/pnp/unreal/whitelabel.mdx b/docs/sdk/pnp/unreal/whitelabel.mdx index e6549cae9..3781315dd 100644 --- a/docs/sdk/pnp/unreal/whitelabel.mdx +++ b/docs/sdk/pnp/unreal/whitelabel.mdx @@ -13,8 +13,8 @@ class called `whiteLabel`. This parameter takes another object called `WhiteLabe :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -32,16 +32,16 @@ This is a paid feature and the minimum [pricing plan](https://web3auth.io/pricin -| Parameter | Type | Mandatory | Description | -| ----------------- | ------------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `appName` | `string` | Yes | The name of your dApp. | -| `logoLight` | `string` | Yes | The URL of the logo for light mode. | -| `logoDark` | `string` | Yes | The URL of the logo for dark mode. | -| `defaultLanguage` | `FLanguage` | No | Default Language to use.
Choose from:
  • `FLanguage::en` - English
  • `FLanguage::de` - German
  • `FLanguage::ja` - Japanese
  • `FLanguage::ko` - Korean
  • `FLanguage::zh` - Mandarin
  • `FLanguage::es` - Spanish
  • `FLanguage::fr` - French
  • `FLanguage::pt` - Portuguese
  • `FLanguage::nl` - Dutch
| -| `mode` | `FThemeModes` | No | Choose between `auto`, `light` or `dark` modes. | -| `theme` | `TMap` | No | The theme for your dApp. | -| `appUrl` | `string` | No | The URL of your dApp. | -| `useLogoLoader` | `bool` | No | Use the logo loader for your dApp. | +| Parameter | Description | +| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `appName?` | Display name for the app in the UI. | +| `logoLight?` | App logo to be used in dark mode. It accepts url in `FString` as a value. | +| `logoDark?` | App logo to be used in light mode. It accepts url in `FString` as a value. | +| `defaultLanguage?` | Language which will be used by Web3Auth, app will use browser language if not specified. Default language is `FLanguage::en`. Checkout `FLanguage` for supported languages. | +| `mode?` | Theme mode for the login modal. Choose between `FThemeModes::auto`, `FThemeModes::light` or `FThemeModes::dark` background modes. | +| `theme?` | Used to customize the theme of the login modal. It accepts `TMap` as a value. | +| `appUrl?` | Url to be used in the Modal. It accepts url in `FString` as a value. | +| `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are null, the default Web3Auth logo will be used for the loader. Default value is false. |
diff --git a/docs/sdk/pnp/web/wagmi-connector.mdx b/docs/sdk/pnp/web/wagmi-connector.mdx index d366469f2..baf588709 100644 --- a/docs/sdk/pnp/web/wagmi-connector.mdx +++ b/docs/sdk/pnp/web/wagmi-connector.mdx @@ -61,11 +61,11 @@ import { Web3AuthConnector } from "@web3auth/web3auth-wagmi-connector"; -| Parameter | type | description | -| ------------------ | ------------------------------------------ | -------------------------------------------------------------------------------- | -| `web3AuthInstance` | `IWeb3Auth` or `IWeb3AuthModal` | Pass the Web3Auth instance here | -| `loginParams?` | `OpenloginLoginParams` | Login Parameters (only meant while using the `@web3auth/no-modal` package) | -| `modalConfig?` | `Record` | Initialisation Parameters (only meant while using the `@web3auth/modal` package) | +| Parameter | Description | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `web3AuthInstance` | Pass the Web3Auth instance here. It's the mandatory field and accepts `IWeb3Auth` or `IWeb3AuthModal`. | +| `loginParams?` | Login Parameters (only meant while using the `@web3auth/no-modal` package). It accepts `OpenloginLoginParams`. | +| `modalConfig?` | Initialisation Parameters (only meant while using the `@web3auth/modal` package). It accepts `Record`. | diff --git a/src/common/sdk/pnp/web/_add-chain.mdx b/src/common/sdk/pnp/web/_add-chain.mdx index 576b549b9..4b06b1fa5 100644 --- a/src/common/sdk/pnp/web/_add-chain.mdx +++ b/src/common/sdk/pnp/web/_add-chain.mdx @@ -16,9 +16,9 @@ following parameter: -| Variable | Type | Description | Mandatory | -| ------------- | ------------------- | ------------------- | --------- | -| `chainConfig` | `CustomChainConfig` | Custom Chain Config | Yes | +| Variable | Description | +| ------------- | -------------------------------------------------- | +| `chainConfig` | `CustomChainConfig` for the chain you want to add. | diff --git a/src/common/sdk/pnp/web/_chain-config.mdx b/src/common/sdk/pnp/web/_chain-config.mdx index 72ba6aaea..130d09d9e 100644 --- a/src/common/sdk/pnp/web/_chain-config.mdx +++ b/src/common/sdk/pnp/web/_chain-config.mdx @@ -11,19 +11,19 @@ import Tabs from "@theme/Tabs"; -| Parameter | Type | Description | Optional | -| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -| `chainNamespace` |
  • **`string`** - (Choose between `eip155`, `solana` & `other`)
  • **or**
  • **`ChainNamespaceType`** - (Choose between `CHAIN_NAMESPACES.EIP155`, `CHAIN_NAMESPACES.SOLANA` & `CHAIN_NAMESPACES.OTHER`)
| The namespace of your preferred chain. Checkout [Providers SDK Reference](/sdk/helper-sdks/providers) for understanding RPC Calls. | No | -| `chainId` | `string` | The chain id of the selected blockchain in `hex` | No | -| `rpcTarget` | `string` |
  • RPC Target URL for the selected `chainNamespace` & `chainId`.
  • We provide a default RPC Target for certain blockchains, but due to congestion it might be slow hence it is recommended to provide your own RPC Target URL.
| No | -| `wsTarget` | `string` | Web socket target URL for the chain | Yes | -| `displayName` | `string` | Display Name for the chain | No | -| `blockExplorerUrl`| `string` | Blockchain's explorer URL. (eg: `https://etherscan.io`) | No | -| `ticker` | `string` | Default currency ticker of the network (e.g: `ETH`) | No | -| `tickerName` | `string` | Name for currency ticker (e.g: `Ethereum`) | No | -| `decimals` | `number` | Number of decimals for the currency ticker (e.g: `18`) | Yes | -| `logo` | `string` | Logo for the chain | Yes | -| `isTestnet` | `boolean` | Defines whether the network is testnet or not. | Yes | +| Parameter | Description | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `chainNamespace` | The namespace of your preferred chain. Checkout [Providers SDK Reference](/sdk/helper-sdks/providers) for understanding RPC Calls. It accepts `ChainNamespaceType` as a value. | +| `chainId` | The chain id of the selected blockchain in hex `string` format. | +| `rpcTarget` |
  • RPC Target URL for the selected `chainNamespace` & `chainId`.
  • We provide a default RPC Target for certain blockchains, but due to congestion it might be slow hence it is recommended to provide your own RPC Target URL.
| +| `wsTarget` | Web socket target URL for the chain in `string`. | +| `displayName` | Display Name for the chain in `string`. | +| `blockExplorerUrl` | Blockchain's explorer URL in `string`. (eg: `https://etherscan.io`) | +| `ticker` | Default currency ticker in `string` for the network (e.g: `ETH`) | +| `tickerName` | Name for currency ticker in `string` (e.g: `Ethereum`) | +| `decimals?` | Number of decimals in `number` for the currency ticker (e.g: `18`) | +| `logo` | Logo for the chain. | +| `isTestnet?` | Defines whether the network is testnet or not. |
@@ -36,7 +36,7 @@ declare const CHAIN_NAMESPACES: { readonly OTHER: "other"; }; -declare type ChainNamespaceType = typeof CHAIN_NAMESPACES[keyof typeof CHAIN_NAMESPACES]; +declare type ChainNamespaceType = (typeof CHAIN_NAMESPACES)[keyof typeof CHAIN_NAMESPACES]; declare type CustomChainConfig = { chainNamespace: ChainNamespaceType; /** diff --git a/src/common/sdk/pnp/web/_connect-to.mdx b/src/common/sdk/pnp/web/_connect-to.mdx index f3e4e0ead..8fdef85a6 100644 --- a/src/common/sdk/pnp/web/_connect-to.mdx +++ b/src/common/sdk/pnp/web/_connect-to.mdx @@ -16,10 +16,10 @@ process according to your own needs, by taking the following parameters: -| Variable | Type | Description | Mandatory | -| ------------- | --------------------- | ------------------------------------------------------- | --------- | -| `walletName` | `WALLET_ADAPTER_TYPE` | Wallet Adapter you want to use for logging in your user | Yes | -| `loginParams` | `object` | Login Parameters specific to your wallet adapter | No | +| Variable | Description | +| -------------- | ------------------------------------------------------------------------------------------ | +| `walletName` | Wallet Adapter you want to use for logging in your user. It accepts `WALLET_ADAPTER_TYPE`. | +| `loginParams?` | Login Parameters specific to your wallet adapter. | @@ -30,7 +30,7 @@ process according to your own needs, by taking the following parameters: ``` ```tsx -export type WALLET_ADAPTER_TYPE = typeof WALLET_ADAPTERS[keyof typeof WALLET_ADAPTERS]; +export type WALLET_ADAPTER_TYPE = (typeof WALLET_ADAPTERS)[keyof typeof WALLET_ADAPTERS]; export declare const WALLET_ADAPTERS: { OPENLOGIN: string; WALLET_CONNECT_V2: string; diff --git a/src/common/sdk/pnp/web/_extra-login-options.mdx b/src/common/sdk/pnp/web/_extra-login-options.mdx index 16a340f34..dae84d340 100644 --- a/src/common/sdk/pnp/web/_extra-login-options.mdx +++ b/src/common/sdk/pnp/web/_extra-login-options.mdx @@ -13,20 +13,26 @@ import Tabs from "@theme/Tabs"; ##### `ExtraLoginOptions` -| Variable | Type | Description | Mandatory | -| ---------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------- | -| `domain?` | `string` | The target domain for your proxy login provider like Auth0, such as `'example.auth0.com'`, `'example.eu.auth0.com'` or , `'example.mycompany.com'` | Yes | -| `client_id?` | `string` | The Client ID of your login provider, found on your Application settings page | No | -| `redirect_uri?` | `string` | The default URL where the login provider will redirect your browser to with the authentication result. It must be whitelisted in the "Allowed Callback URLs" field in your Application's settings. If not provided here, it should be provided in the other methods that provide authentication. | No | -| `leeway?` | `number` | The value in seconds used to account for clock skew in JWT expirations. Typically, this value is no more than a minute or two at maximum. **Default Value:** `60` | No | -| `verifierIdField?` | `string` | The field in jwt token which maps to verifier id | No | -| `isVerifierIdCaseSensitive?` | `boolean` | Whether the verifier id field is case sensitive. **Default Value:** `true` | No | -| `max_age?` | `string` or `number` | Maximum allowable elapsed time (in seconds) since authentication. If the last time the user authenticated is greater than this value, the user must be re-authenticated. | No | -| `id_token?` | `string` | Pass your own generated or obtained `id_token` to login using JWT. | No | -| `login_hint?` | `string` | The user's email address or other identifier. When your app knows which user is trying to authenticate, you can provide this parameter to pre-fill the email box or select the right session for sign-in. | No | -| `scope?` | `string` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. | No | -| `audience?` | `string` | The default audience to be used for requesting API access. | No | -| `connection?` | `string` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. | No | +| Parameter | Description | +| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalParams?` | Additional params in `[key: string]` format for OAuth login, use id_token(JWT) to authenticate with web3auth. | +| `domain?` | Your custom authentication domain in `string` format. For example, if you are using Auth0, it can be example.au.auth0.com. | +| `client_id?` | Client id in `string` format, provided by your login provider used for custom verifier. | +| `leeway?` | The value used to account for clock skew in JWT expirations. The value is in the seconds, and ideally should no more than 60 seconds or 120 seconds at max. It takes `string` as a value. | +| `verifierIdField?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It takes `string` as a value. | +| `isVerifierIdCaseSensitive?` | `boolean` to confirm Whether the verifier id field is case sensitive or not. | +| `display?` | Allows developers the configure the display of UI. It takes `string` as a value. | +| `prompt?` | Prompt shown to the user during authentication process. It takes `string` as a value. | +| `max_age?` | Max time allowed without reauthentication. If the last time user authenticated is greater than this value, then user must reauthenticate. It takes `string` as a value. | +| `ui_locales?` | The space separated list of language tags, ordered by preference. For instance `fr-CA fr en`. | +| `id_token_hint?` | It denotes the previously issued ID token. It takes `string` as a value. | +| `id_token?` | JWT (ID Token) to be passed for login. | +| `login_hint?` | It is used to send the user's email address during Email Passwordless login. It takes `string` as a value. | +| `acr_values?` | acc_values | +| `scope?` | The default scope to be used on authentication requests. The defaultScope defined in the Auth0Client is included along with this scope. It takes `string` as a value. | +| `audience?` | The audience, presented as the aud claim in the access token, defines the intended consumer of the token. It takes `string` as a value. | +| `connection?` | The name of the connection configured for your application. If null, it will redirect to the Auth0 Login Page and show the Login Widget. It takes `string` as a value. | +| `redirect_uri?` | It can be used to specify the default url, where your custom jwt verifier can redirect your browser to with the result. If you are using Auth0, it must be whitelisted in the Allowed Callback URLs in your Auth0's application. | diff --git a/src/common/sdk/pnp/web/_login-config.mdx b/src/common/sdk/pnp/web/_login-config.mdx index 50c482cd8..6ebf90209 100644 --- a/src/common/sdk/pnp/web/_login-config.mdx +++ b/src/common/sdk/pnp/web/_login-config.mdx @@ -15,23 +15,23 @@ import Tabs from "@theme/Tabs"; `params` -| Parameter | Type | Description | Mandatory | -| --------------------------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -| `verifier` | `string` | Identifier for the Verifier you created on the [Web3Auth Developer Dashboard](https://dashboard.web3auth.io) | Yes | -| `typeOfLogin` | `TypeOfLogin` | Choose your type of social login. Select from the list: `google`, `facebook`, `twitter`, `reddit`, `discord`, `twitch`, `apple`, `line`, `github`, `kakao`, `linkedin`, `weibo`, `wechat` | Yes | -| `name` | `string` | Display Name. If not provided, we use the default for openlogin app | No | -| `description?` | `string` | Description for button. If provided, it renders as a full-length button. else, icon button | No | -| `clientId?` | `string` | Custom client_id for the corresponding social provider. This is needed for connecting to your account. If not provided, we use the default for openlogin app | No | -| `verifierSubIdentifier?` | `string` | Sub identifier - used in case of creation of aggregate verifiers | No | -| `logoHover?` | `string` | Logo to be shown on mouse hover. If not provided, we use the default for openlogin app | No | -| `logoLight?` | `string` | Logo to be shown on a light background (light mode). If not provided, we use the default for openlogin app | No | -| `logoDark?` | `string` | Logo to be shown on a dark background (dark mode). If not provided, we use the default for openlogin app | No | -| `mainOption?` | `boolean` | Show login button on the main list | No | -| `showOnModal?` | `boolean` | Whether to show the login button on modal or not | -| `showOnDesktop` | `boolean` | Whether to show the login button on desktop | No | -| `showOnMobile?` | `boolean` | Whether to show the login button on mobile | No | -| `showOnSocialBackupFactor?` | `boolean` | If we are using social logins as a backup factor, then this option will be used to show the type of social login on the social backup login screen. | No | -| `jwtParameters?` | `JwtParameters` | Custom jwt parameters to configure the login. Useful for Auth0 configuration | No | +| Parameter | Description | +| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verifier` | The name of the verifier that you have registered on the Web3Auth Dashboard. It's a mandatory field, and accepts `string` as a value. | +| `typeOfLogin` | Type of login of this verifier, this value will affect the login flow that is adapted. For example, if you choose `google`, a Google sign-in flow will be used. If you choose `jwt`, you should be providing your own JWT token, no sign-in flow will be presented. It's a mandatory field, and accepts `TypeOfLogin` as a value. | +| `clientId` | Client id provided by your login provider used for custom verifier. e.g. Google's Client ID or Web3Auth's client Id if using 'jwt' as TypeOfLogin. It's a mandatory field, and accepts `string` as a value. | +| `name?` | Display name for the verifier. If null, the default name is used. It accepts `string` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `string` as a value. | +| `verifierSubIdentifier?` | The field in JWT token which maps to verifier id. Please make sure you selected correct JWT verifier id in the developer dashboard. It accepts `string` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `string` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `string` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `string` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `boolean` as a value. Default value is false. | +| `showOnModal?` | Whether to show the login button on modal or not. Default value is true. | +| `showOnDesktop?` | Whether to show the login button on desktop. Default value is true. | +| `showOnMobile?` | Whether to show the login button on mobile. Default value is true. | +| `showOnSocialBackupFactor?` | If we are using social logins as a backup factor, then this option will be used to show the type of social login on the social backup login screen. | +| `jwtParameters?` | Custom jwt parameters to configure the login. Useful for Auth0 configuration. It accepts `JwtParameters` as a value. | diff --git a/src/common/sdk/pnp/web/_modal-config.mdx b/src/common/sdk/pnp/web/_modal-config.mdx index ac23dda27..5eaf384b4 100644 --- a/src/common/sdk/pnp/web/_modal-config.mdx +++ b/src/common/sdk/pnp/web/_modal-config.mdx @@ -13,18 +13,18 @@ import Tabs from "@theme/Tabs"; `modalConfig: { ADAPTER : { params } }` -| Parameter | Type | Description | Default | Mandatory | -| ---------------- | --------- | --------------------------------------------- | ------------------------------------------- | --------- | -| `label` | `string` | Label of the adapter you want to configure | NA - _identifier for corresponding adapter_ | Yes | -| `showOnModal?` | `boolean` | Whether to show an adapter in modal or not. | true | No | -| `showOnDesktop?` | `boolean` | Whether to show an adapter in desktop or not. | true | No | -| `showOnMobile?` | `boolean` | Whether to show an adapter in mobile or not. | true | No | +| Parameter | Description | +| ---------------- | ------------------------------------------------------------------------------------------ | +| `label` | Label of the adapter you want to configure. It's a mandatory field which accepts `string`. | +| `showOnModal?` | Whether to show an adapter in modal or not. Default value is `true`. | +| `showOnDesktop?` | Whether to show an adapter in desktop or not. Default value is `true`. | +| `showOnMobile?` | Whether to show an adapter in mobile or not. Default value is `true`. | Additionally, to configure the Openlogin Adapter's each login method, we have the `loginMethods?` parameter. -| Parameter | Type | Description | Default | Mandatory | -| --------------- | ------------------- | ------------------------------------------------------------------------------ | ------------------------------------------- | --------- | -| `loginMethods?` | `LoginMethodConfig` | To configure visibility of each social login method for the openlogin adapter. | Default `LoginMethod` for each social login | No | +| Parameter | Description | +| --------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `loginMethods?` | To configure visibility of each social login method for the openlogin adapter. It accepts `LoginMethodConfig` as a value. | @@ -71,17 +71,17 @@ For `labels` you can choose between these options: `google`, `facebook`, `twitte `params` -| Parameter | Type | Description | Default | Mandatory | -| ---------------- | --------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------- | --------- | -| `name` | `string` | Display Name | Default for Openlogin App | No | -| `description?` | `string` | Description for button. If provided, it renders as a full length button. else, icon button | Just an icon rendered | No | -| `logoHover?` | `string` | Logo to be shown on mouse hover | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `logoLight?` | `string` | Logo to be shown on dark background (dark theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `logoDark?` | `string` | Logo to be shown on light background (light theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `mainOption?` | `boolean` | Show login button on the main list | Default for Openlogin App | No | -| `showOnModal?` | `string` | Whether to show the login button on modal or not | Default for Openlogin App | No | -| `showOnDesktop?` | `string` | Whether to show the login button on desktop | Default for Openlogin App | No | -| `showOnMobile?` | `string` | Whether to show the login button on mobile | Default for Openlogin App | No | +| Parameter | Description | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `name?` | Display Name. It accepts `string` as a value. | +| `description?` | Description for the button. If provided, it renders as a full length button. else, icon button. It accepts `string` as a value. | +| `logoHover?` | Logo to be shown on mouse hover. It accepts `string` as a value. | +| `logoLight?` | Light logo for dark background. It accepts `string` as a value. | +| `logoDark?` | Dark logo for light background. It accepts `string` as a value. | +| `mainOption?` | Show login button on the main list. It accepts `oolean` as a value. Default value is false. | +| `showOnModal?` | Whether to show the login button on modal or not. Default value is true. | +| `showOnDesktop?` | Whether to show the login button on desktop. Default value is true. | +| `showOnMobile?` | Whether to show the login button on mobile. Default value is true. | diff --git a/src/common/sdk/pnp/web/_openlogin-adapter-settings.mdx b/src/common/sdk/pnp/web/_openlogin-adapter-settings.mdx index 90cda3ca7..bf873711c 100644 --- a/src/common/sdk/pnp/web/_openlogin-adapter-settings.mdx +++ b/src/common/sdk/pnp/web/_openlogin-adapter-settings.mdx @@ -10,17 +10,17 @@ import Tabs from "@theme/Tabs"; -| Variable | Type | Description | Mandatory | Default Value | -| ----------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------------- | -| `clientId?` | `string` | Client ID for web3auth. Obtain your `clientId` from the [Web3Auth Developer Dashboard](https://dashboard.web3auth.io/). Not required if you're passing the clientId in the web3auth core constructor. | No | N/A | -| `network` | `enum` (`testnet`, `mainnet`, `cyan`, `aqua`, ) | Network specifies the openlogin iframe url url to be used.
  • `'mainnet'`: https://app.openlogin.com will be used which is the production version.
  • `'cyan'`: https://cyan.openlogin.com will be used which is the production cyan version.
  • `'testnet'`: https://beta.openlogin.com will be used which is the beta version.
| Yes | N/A | -| `redirectUrl?` | `string` | redirectUrl is the dapp's url where user will be redirected after login. Register this url on the [Web3Auth Developer Dashboard](https://dashboard.web3auth.io/) else initialization will give error. | No | N/A | -| `uxMode?` | `enum` (`popup` and `redirect` ) | Two uxModes are supported:
  • `'POPUP'`: In this uxMode, a popup will be shown to user for login.
  • `'REDIRECT'`: In this uxMode, user will be redirected to a new window tab for login.
| No | `'POPUP'` | -| `replaceUrlOnRedirect?` | `boolean` | replaceUrlOnRedirect removes the params from the redirected url after login | No | `true` | -| `loginConfig?` | `LoginConfig` | loginConfig enables you to pass your own login verifiers configuration for various loginProviders. loginConfig is key value map where each key should be a valid loginProvider and value should be custom configuration for that loginProvider. | No | N/A | -| `whiteLabel?` | `WhiteLabelData` | Options for whitelabling default openlogin modal. | No | N/A | -| `useCoreKitKey?` | `boolean` | Use `useCoreKitKey` as `true`, if you're using this SDK with the Single Factor Auth Web SDK | No | | -| `mfaSettings?` | `MfaSettings` | MFA Settings for the user. `SCALE and above plan only feature.` | No | N/A | +| Variable | Description | +| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId?` | Client ID for web3auth. Obtain your `clientId` from the [Web3Auth Developer Dashboard](https://dashboard.web3auth.io/). Not required if you're passing the clientId in the web3auth core constructor. It accepts `string` as a value. | +| `network` | Network specifies the openlogin iframe url url to be used.
  • `'mainnet'`: https://app.openlogin.com will be used which is the production version.
  • `'cyan'`: https://cyan.openlogin.com will be used which is the production cyan version.
  • `'testnet'`: https://beta.openlogin.com will be used which is the beta version.
. It accepts `OPENLOGIN_NETWORK_TYPE` as a value. | +| `redirectUrl?` | redirectUrl is the dapp's url where user will be redirected after login. Register this url on the [Web3Auth Developer Dashboard](https://dashboard.web3auth.io/) else initialization will give error. It accepts `string` as a value. | +| `uxMode?` | Two uxModes are supported:
  • `'POPUP'`: In this uxMode, a popup will be shown to user for login.
  • `'REDIRECT'`: In this uxMode, user will be redirected to a new window tab for login.
. Default value is "POPUP". | +| `replaceUrlOnRedirect?` | `replaceUrlOnRedirect` removes the params from the redirected url after login. Default value is `true`. | +| `loginConfig?` | `loginConfig` enables you to pass your own login verifiers configuration for various loginProviders. loginConfig is key value map where each key should be a valid loginProvider and value should be custom configuration for that loginProvider. | +| `whiteLabel?` | Options for whitelabling default openlogin modal. It accepts `WhiteLabelData` as a value. | +| `useCoreKitKey?` | Use `useCoreKitKey` as `true`, if you're using this SDK with the Single Factor Auth Web SDK. Default value is `false`. | +| `mfaSettings?` | MFA Settings for the user. `SCALE and above plan only feature`. It accepts `MfaSettings` as a value. |
diff --git a/src/common/sdk/pnp/web/_openlogin-login-params.mdx b/src/common/sdk/pnp/web/_openlogin-login-params.mdx index e0496870b..a47b2f3a9 100644 --- a/src/common/sdk/pnp/web/_openlogin-login-params.mdx +++ b/src/common/sdk/pnp/web/_openlogin-login-params.mdx @@ -13,16 +13,15 @@ import Tabs from "@theme/Tabs"; ##### `LoginSettings` -| Variable | Type | Description | Mandatory | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -| `loginProvider` | `LOGIN_PROVIDER_TYPE` or `CUSTOM_LOGIN_PROVIDER_TYPE` - `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`, `SMS_PASSWORDLESS`, `JWT` | Sets the oauth login method to be used. You can use any of the valid loginProvider from the supported list.

The list of available options: `google`, `facebook`, `reddit`, `discord`, `twitch`, `apple`, `line`, `github`, `kakao`, `linkedin`, `twitter`, `weibo`, `wechat`, `email_passwordless`, `sms_passwordless`, `jwt` | No | -| `mfaLevel?` | `MfaLevelType` | You can set the `mfaLevel` to customize when mfa screen should be shown to user. It currently accepts 4 values:
  • **`'default'`** Setting mfa level to `default` will present mfa screen to user on every third login.
  • **`'optional'`** Setting mfa level to `default` will present mfa screen to user on every login but user can skip it.
  • **`'mandatory'`** Setting mfa level to `mandatory` will make it mandatory for user to setup mfa after login.
  • **`'none'`** Setting mfa level to `none` will make the user skip the mfa setup screen
| No | -| `extraLoginOptions?` | `ExtraLoginOptions` | This can be used to pass standard oauth login options to loginProvider. For ex: you will have to pass `login_hint` as user's email and `domain` as your app domain in `extraLoginOptions` while using `email_passwordless` loginProvider | No | -| `dappShare?` | `string` | Custom Logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. `dappShare` is a 24 word seed phrase. | No | -| `curve` | `SUPPORTED_KEY_CURVES_TYPE` | This curve will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. You can use that public key from jwt token as a unique user identifier in your backend.
  • `'secp256k1'`: secp256k1 based pub key is added as a wallet public key in jwt token to use.
  • `'ed25519'`: ed25519 based pub key is added as a wallet public key in jwt token to use.
Note: This parameter won't change format of private key returned by openlogin. Private key returned by openlogin is always `secp256k1`. | No | -| `appState?` | `string` | Any custom state you wish to pass along. This will be returned to you post redirect. Use this to store data that you want to be available to the dApp after login. | No | -| `redirectUrl?` | `string` | DApp's URL where user will be redirected after login. Register this URL in the [developer dashboard](https://dashboard.web3auth.io), else initialization will give error. | No | -| `login_hint?` | `string` | | No | +| Variable | Description | +| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginProvider` | Sets the OAuth login method to be used. You can use any of the valid loginProvider from the supported list.

The list of available options: `google`, `facebook`, `reddit`, `discord`, `twitch`, `apple`, `line`, `github`, `kakao`, `linkedin`, `twitter`, `weibo`, `wechat`, `email_passwordless`, `sms_passwordless`, `jwt` | +| `mfaLevel?` | You can set the `mfaLevel` to customize when mfa screen should be shown to user. It currently accepts 4 values:
  • **`'default'`** Setting mfa level to `default` will present mfa screen to user on every third login.
  • **`'optional'`** Setting mfa level to `default` will present mfa screen to user on every login but user can skip it.
  • **`'mandatory'`** Setting mfa level to `mandatory` will make it mandatory for user to setup mfa after login.
  • **`'none'`** Setting mfa level to `none` will make the user skip the mfa setup screen
| +| `extraLoginOptions?` | This can be used to pass standard oauth login options to loginProvider. For ex: you will have to pass `login_hint` as user's email and `domain` as your app domain in `extraLoginOptions` while using `email_passwordless` loginProvider. It accepts `ExtraLoginOptions` as a value. | +| `dappShare?` | Custom logins can get a dApp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. `dappShare` is a 24 word seed phrase. It accepts `string` as a value. | +| `curve?` | This curve will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. You can use that public key from jwt token as a unique user identifier in your backend.
  • `'secp256k1'`: secp256k1 based pub key is added as a wallet public key in jwt token to use.
  • `'ed25519'`: ed25519 based pub key is added as a wallet public key in jwt token to use.
Note: This parameter won't change format of private key returned by openlogin. Private key returned by openlogin is always `secp256k1`. It accepts `SUPPORTED_KEY_CURVES_TYPE` as a value. | +| `appState?` | Any custom state you wish to pass along. This will be returned to you post redirect. Use this to store data that you want to be available to the dApp after login. It accepts `string` as a value. | +| `redirectUrl?` | App's URL where user will be redirected after login. Register this URL in the [developer dashboard](https://dashboard.web3auth.io), else initialization will give error. It accepts `string` as a value. | @@ -101,7 +100,7 @@ export type BaseRedirectParams = { /** * {@label loginProviderType} */ -export type LOGIN_PROVIDER_TYPE = typeof LOGIN_PROVIDER[keyof typeof LOGIN_PROVIDER]; +export type LOGIN_PROVIDER_TYPE = (typeof LOGIN_PROVIDER)[keyof typeof LOGIN_PROVIDER]; export declare const LOGIN_PROVIDER: { readonly GOOGLE: "google"; readonly FACEBOOK: "facebook"; @@ -130,7 +129,7 @@ export type CUSTOM_LOGIN_PROVIDER_TYPE = string & { * {@label MfaLevelType} */ -export type MfaLevelType = typeof MFA_LEVELS[keyof typeof MFA_LEVELS]; +export type MfaLevelType = (typeof MFA_LEVELS)[keyof typeof MFA_LEVELS]; export declare const MFA_LEVELS: { readonly DEFAULT: "default"; readonly OPTIONAL: "optional"; @@ -142,7 +141,7 @@ export declare const MFA_LEVELS: { * {@label SUPPORTED_KEY_CURVES_TYPE} */ -export type SUPPORTED_KEY_CURVES_TYPE = typeof SUPPORTED_KEY_CURVES[keyof typeof SUPPORTED_KEY_CURVES]; +export type SUPPORTED_KEY_CURVES_TYPE = (typeof SUPPORTED_KEY_CURVES)[keyof typeof SUPPORTED_KEY_CURVES]; export declare const SUPPORTED_KEY_CURVES: { readonly SECP256K1: "secp256k1"; readonly ED25519: "ed25519"; diff --git a/src/common/sdk/pnp/web/_openlogin-login-settings.mdx b/src/common/sdk/pnp/web/_openlogin-login-settings.mdx index 0e46aa806..2da6d423f 100644 --- a/src/common/sdk/pnp/web/_openlogin-login-settings.mdx +++ b/src/common/sdk/pnp/web/_openlogin-login-settings.mdx @@ -10,15 +10,15 @@ import Tabs from "@theme/Tabs"; -| Variable | Type | Description | Mandatory | -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -| `loginProvider` | `LOGIN_PROVIDER_TYPE` or `CUSTOM_LOGIN_PROVIDER_TYPE` - `GOOGLE`, `FACEBOOK`, `REDDIT`, `DISCORD`, `TWITCH`, `APPLE`, `LINE`, `GITHUB`, `KAKAO`, `LINKEDIN`, `TWITTER`, `WEIBO`, `WECHAT`, `EMAIL_PASSWORDLESS`, `SMS_PASSWORDLESS`, `JWT` | Sets the oauth login method to be used. You can use any of the valid loginProvider from the supported list.

The list of available options: `google`, `facebook`, `reddit`, `discord`, `twitch`, `apple`, `line`, `github`, `kakao`, `linkedin`, `twitter`, `weibo`, `wechat`, `email_passwordless`, `sms_passwordless`, `jwt` | No | -| `mfaLevel?` | `MfaLevelType` | You can set the `mfaLevel` to customize when mfa screen should be shown to user. It currently accepts 4 values:
  • **`'default'`** Setting mfa level to `default` will present mfa screen to user on every third login.
  • **`'optional'`** Setting mfa level to `default` will present mfa screen to user on every login but user can skip it.
  • **`'mandatory'`** Setting mfa level to `mandatory` will make it mandatory for user to setup mfa after login.
  • **`'none'`** Setting mfa level to `none` will make the user skip the mfa setup screen
| No | -| `extraLoginOptions?` | `ExtraLoginOptions` | This can be used to pass standard oauth login options to loginProvider. For ex: you will have to pass `login_hint` as user's email and `domain` as your app domain in `extraLoginOptions` while using `email_passwordless` loginProvider | No | -| `dappShare?` | `string` | Custom Logins can get a dapp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. `dappShare` is a 24 word seed phrase. | No | -| `curve` | `SUPPORTED_KEY_CURVES_TYPE` | This curve will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. You can use that public key from jwt token as a unique user identifier in your backend.
  • `'secp256k1'`: secp256k1 based pub key is added as a wallet public key in jwt token to use.
  • `'ed25519'`: ed25519 based pub key is added as a wallet public key in jwt token to use.
Note: This parameter won't change format of private key returned by openlogin. Private key returned by openlogin is always `secp256k1`. | No | -| `redirectUrl?` | `string` | DApp's URL where user will be redirected after login. Register this URL in the [developer dashboard](https://dashboard.web3auth.io), else initialization will give error. | No | -| `appState?` | `string` | Any custom state you wish to pass along. This will be returned to you post redirect. Use this to store data that you want to be available to the dApp after login. | No | +| Variable | Description | +| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginProvider` | Sets the OAuth login method to be used. You can use any of the valid loginProvider from the supported list.

The list of available options: `google`, `facebook`, `reddit`, `discord`, `twitch`, `apple`, `line`, `github`, `kakao`, `linkedin`, `twitter`, `weibo`, `wechat`, `email_passwordless`, `sms_passwordless`, `jwt` | +| `mfaLevel?` | You can set the `mfaLevel` to customize when mfa screen should be shown to user. It currently accepts 4 values:
  • **`'default'`** Setting mfa level to `default` will present mfa screen to user on every third login.
  • **`'optional'`** Setting mfa level to `default` will present mfa screen to user on every login but user can skip it.
  • **`'mandatory'`** Setting mfa level to `mandatory` will make it mandatory for user to setup mfa after login.
  • **`'none'`** Setting mfa level to `none` will make the user skip the mfa setup screen
| +| `extraLoginOptions?` | This can be used to pass standard oauth login options to loginProvider. For ex: you will have to pass `login_hint` as user's email and `domain` as your app domain in `extraLoginOptions` while using `email_passwordless` loginProvider. It accepts `ExtraLoginOptions` as a value. | +| `dappShare?` | Custom logins can get a dApp share returned to them post successful login. This is useful if the dapps want to use this share to allow users to login seamlessly. `dappShare` is a 24 word seed phrase. It accepts `string` as a value. | +| `curve?` | This curve will be used to determine the public key encoded in the jwt token which returned in `getUserInfo` function after user login. You can use that public key from jwt token as a unique user identifier in your backend.
  • `'secp256k1'`: secp256k1 based pub key is added as a wallet public key in jwt token to use.
  • `'ed25519'`: ed25519 based pub key is added as a wallet public key in jwt token to use.
Note: This parameter won't change format of private key returned by openlogin. Private key returned by openlogin is always `secp256k1`. It accepts `SUPPORTED_KEY_CURVES_TYPE` as a value. | +| `appState?` | Any custom state you wish to pass along. This will be returned to you post redirect. Use this to store data that you want to be available to the dApp after login. It accepts `string` as a value. | +| `redirectUrl?` | App's URL where user will be redirected after login. Register this URL in the [developer dashboard](https://dashboard.web3auth.io), else initialization will give error. It accepts `string` as a value. |
@@ -97,7 +97,7 @@ export declare type BaseRedirectParams = { /** * {@label loginProviderType} */ -export declare type LOGIN_PROVIDER_TYPE = typeof LOGIN_PROVIDER[keyof typeof LOGIN_PROVIDER]; +export declare type LOGIN_PROVIDER_TYPE = (typeof LOGIN_PROVIDER)[keyof typeof LOGIN_PROVIDER]; export declare const LOGIN_PROVIDER: { readonly GOOGLE: "google"; readonly FACEBOOK: "facebook"; @@ -126,7 +126,7 @@ export type CUSTOM_LOGIN_PROVIDER_TYPE = string & { * {@label MfaLevelType} */ -export declare type MfaLevelType = typeof MFA_LEVELS[keyof typeof MFA_LEVELS]; +export declare type MfaLevelType = (typeof MFA_LEVELS)[keyof typeof MFA_LEVELS]; export declare const MFA_LEVELS: { readonly DEFAULT: "default"; readonly OPTIONAL: "optional"; @@ -138,7 +138,7 @@ export declare const MFA_LEVELS: { * {@label SUPPORTED_KEY_CURVES_TYPE} */ -export declare type SUPPORTED_KEY_CURVES_TYPE = typeof SUPPORTED_KEY_CURVES[keyof typeof SUPPORTED_KEY_CURVES]; +export declare type SUPPORTED_KEY_CURVES_TYPE = (typeof SUPPORTED_KEY_CURVES)[keyof typeof SUPPORTED_KEY_CURVES]; export declare const SUPPORTED_KEY_CURVES: { readonly SECP256K1: "secp256k1"; readonly ED25519: "ed25519"; diff --git a/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx b/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx index 70090a222..d1411e804 100644 --- a/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx +++ b/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx @@ -17,17 +17,17 @@ The whitelabel parameter takes `WhitelabelData` as input. The `WhitelabelData` o `WhiteLabelData` -| Parameter | Type | Description | Default | Mandatory | -| ------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | --------- | -| `appName?` | `string` | App name to be displayed in the User Flow Screens. | dApp's Website URL | No | -| `appUrl?` | `string` | App URL to be displayed in the User Flow Screens. | dApp's Website URL | No | -| `logoLight?` | `string` | App logo to be shown on the light background (light theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `logoDark?` | `string` | App logo to be shown on the dark background (dark theme) | [web3auth-logo.svg](https://images.web3auth.io/web3auth-logo.svg) | No | -| `defaultLanguage?` | `string` | Default Language to use.
Choose from:
  • `en` - English
  • `de` - German
  • `ja` - Japanese
  • `ko` - Korean
  • `zh` - Mandarin
  • `es` - Spanish
  • `fr` - French
  • `pt` - Portuguese
  • `nl` - Dutch
  • `tr` - Turkish
| en - English | No | -| `mode?` | `string` | Choose between `auto`, `light` or `dark` background modes. | `auto` | No | -| `theme?` | `{ [P in string]: string; }` | Used to customize the theme of the login modal with the following options
`'primary'` - To customize the primary color of the modal's content | `#0364FF` | No | -| `tncLink?` | `Partial>` | Language specific link for terms and conditions on torus-website. See (examples/vue-app) to configure e.g. tncLink: `{en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja"}` | none | No | -| `privacyPolicy?` | `Partial>` | Language specific link for privacy policy on torus-website. See (examples/vue-app) to configure e.g. `privacyPolicy: { en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja", }` | none | No | +| Parameter | Description | +| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `appName?` | App name to be displayed in the User Flow Screens. It accepts `string` as a value. | +| `appUrl?` | App URL to be displayed in the User Flow Screens. It accepts `string` as a value. | +| `logoLight?` | App logo to be shown on the light background (light theme). It accepts `string` as a value. | +| `logoDark?` | App logo to be shown on the dark background (dark theme). It accepts `string` as a value. | +| `defaultLanguage?` | Default Language to use.
Choose from:
  • `en` - English
  • `de` - German
  • `ja` - Japanese
  • `ko` - Korean
  • `zh` - Mandarin
  • `es` - Spanish
  • `fr` - French
  • `pt` - Portuguese
  • `nl` - Dutch
  • `tr` - Turkish
. Default language is `en` | +| `mode?` | Choose between `auto`, `light` or `dark` background modes. Default is `auto`. | +| `theme?` | Used to customize the theme of the login modal with the following options
`'primary'` - To customize the primary color of the modal's content. It accepts `Record` as a value. | +| `tncLink?` | Language specific link for terms and conditions on torus-website. See (examples/vue-app) to configure e.g. tncLink: `{en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja"}` | +| `privacyPolicy?` | Language specific link for privacy policy on torus-website. See (examples/vue-app) to configure e.g. `privacyPolicy: { en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja", }` | diff --git a/src/common/sdk/pnp/web/_plugin-config.mdx b/src/common/sdk/pnp/web/_plugin-config.mdx index 6a33a6bf2..6efb05ace 100644 --- a/src/common/sdk/pnp/web/_plugin-config.mdx +++ b/src/common/sdk/pnp/web/_plugin-config.mdx @@ -13,10 +13,10 @@ While initializing the Wallet Services plugin, you need to pass on the following -| Parameter | Type | Description | Mandatory | -| -------------------- | ------------------------ | ---------------------------------------------------------------------- | --------- | -| `wsEmbedOpts?` | `CtorArgs` | Configuration options for Wallet Services | No | -| `walletInitOptions?` | `Partial` | Parameters to customize your Wallet Services UI within the application | No | +| Parameter | Description | +| -------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `wsEmbedOpts?` | Configuration options for Wallet Services. It accepts `Partial` as a value. | +| `walletInitOptions?` | Parameters to customize your Wallet Services UI within the application. It accepts `Partial` as a value. | @@ -50,11 +50,11 @@ input which contains the following parameters: `CtorArgs` -| Parameter | Type | Description | -| ------------------ | -------- | ------------------------------- | -| `modalZIndex` | `number` | Z-index of the modal and iframe | -| `web3AuthClientId` | `string` | Web3Auth Client ID | -| `web3AuthNetwork` | `string` | Web3auth network to be used. | +| Parameter | Description | +| ------------------ | ---------------------------------------------------------------------------- | +| `modalZIndex?` | Z-index of the modal and iframe. Default value is 99999 | +| `web3AuthClientId` | Web3Auth Client ID in `string`. | +| `web3AuthNetwork` | Web3auth network to be used. It accepts `OPENLOGIN_NETWORK_TYPE` as a value. | @@ -111,10 +111,10 @@ takes the object `WsEmbedParams` as input which contains multiple parameters tha `WsEmbedParams` -| Parameter | Type | Mandatory | Description | -| -------------- | ------------------ | --------- | -------------------------------------------------------------- | -| `chainConfig?` | `EthereumProvider` | No | Chain config of the Blockchain to connect with. | -| `whiteLabel?` | `WhiteLabelParams` | No | White Label parameters to whitelisting the Wallet Services UI. | +| Parameter | Description | +| -------------- | --------------------------------------------------------------------------------------------- | +| `chainConfig?` | Chain config of the Blockchain to connect with. It accepts `EthereumProviderConfig`. | +| `whiteLabel?` | White Label parameters to whitelisting the Wallet Services UI. It accepts `WhiteLabelParams`. | diff --git a/src/common/sdk/pnp/web/_plugin-whitelabel-config.mdx b/src/common/sdk/pnp/web/_plugin-whitelabel-config.mdx index 4d4109d1e..affa84e75 100644 --- a/src/common/sdk/pnp/web/_plugin-whitelabel-config.mdx +++ b/src/common/sdk/pnp/web/_plugin-whitelabel-config.mdx @@ -13,25 +13,25 @@ The `whiteLabel` parameter takes some basic parameters and `WhiteLabelParams` ob -| Parameter | Type | Description | -| ------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `showWidgetButton` | `boolean` | Whether to show/hide the Wallet Service widget button. | -| `buttonPosition` | `string` | Determines where the Wallet Service widget is visible on the page. [`bottom-left`, `bottom-right`, `top-left`, `top-right`]. `bottom-left` is default. | -| `hideNftDisplay` | `boolean` | Whether to hide the NFT display screen or not. | -| `hideTokenDisplay` | `boolean` | Whether to hide the Token display screen or not. | -| `hideTransfers` | `boolean` | Whether to hide the Transfer button and screen or not. | -| `hideTopup` | `boolean` | Whether to hide the Topup button and screen or not. | -| `hideReceive` | `boolean` | Whether to hide the Receive button and screen or not. | -| `defaultPortfolio` | `string` | The default portfolio to be displayed on the home display screen. [`token`, `nft`] | -| `appName?` | `string` | App name to be displayed in the User Flow Screens. | -| `appUrl?` | `string` | App URL to be displayed in the User Flow Screens. | -| `logoLight?` | `string` | App logo to be shown on the light background (light theme) | -| `logoDark?` | `string` | App logo to be shown on the dark background (dark theme) | -| `defaultLanguage?` | `string` | Default Language to use.
Choose from:
  • `en` - English
  • `de` - German
  • `ja` - Japanese
  • `ko` - Korean
  • `zh` - Mandarin
  • `es` - Spanish
  • `fr` - French
  • `pt` - Portuguese
  • `nl` - Dutch
  • `tr` - Turkish
| -| `mode?` | `string` | Choose between `auto`, `light` or `dark` background modes. | -| `theme?` | `{ [P in string]: string; }` | Used to customize the theme of the login modal with the following options
`'primary'` - To customize the primary color of the modal's content | -| `tncLink?` | `Partial>` | Language specific link for terms and conditions on torus-website. See (examples/vue-app) to configure e.g. tncLink: `{en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja"}` | -| `privacyPolicy?` | `Partial>` | Language specific link for privacy policy on torus-website. See (examples/vue-app) to configure e.g. `privacyPolicy: { en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja", }` | +| Parameter | Description | +| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `showWidgetButton?` | Whether to show/hide the Wallet Service widget button. Default value is `true`. | +| `buttonPosition?` | Determines where the Wallet Service widget is visible on the page. [`bottom-left`, `bottom-right`, `top-left`, `top-right`]. Default is `bottom-left`. | +| `hideNftDisplay?` | Whether to hide the NFT display screen or not. | +| `hideTokenDisplay?` | Whether to hide the Token display screen or not. | +| `hideTransfers?` | Whether to hide the Transfer button and screen or not. | +| `hideTopup?` | Whether to hide the Topup button and screen or not. | +| `hideReceive?` | Whether to hide the Receive button and screen or not. | +| `defaultPortfolio?` | The default portfolio to be displayed on the home display screen. Available options are [`token`, `nft`]. | +| `appName?` | App name to be displayed in the User Flow Screens. It accepts `string` as a value. | +| `appUrl?` | App URL to be displayed in the User Flow Screens. It accepts `string` as a value. | +| `logoLight?` | App logo to be shown on the light background (light theme). It accepts `string` as a value. | +| `logoDark?` | App logo to be shown on the dark background (dark theme). It accepts `string` as a value. | +| `defaultLanguage?` | Default Language to use.
Choose from:
  • `en` - English
  • `de` - German
  • `ja` - Japanese
  • `ko` - Korean
  • `zh` - Mandarin
  • `es` - Spanish
  • `fr` - French
  • `pt` - Portuguese
  • `nl` - Dutch
  • `tr` - Turkish
. Default language is `en` | +| `mode?` | Choose between `auto`, `light` or `dark` background modes. Default is `auto`. | +| `theme?` | Used to customize the theme of the login modal with the following options
`'primary'` - To customize the primary color of the modal's content. It accepts `Record` as a value. | +| `tncLink?` | Language specific link for terms and conditions on torus-website. See (examples/vue-app) to configure e.g. tncLink: `{en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja"}` | +| `privacyPolicy?` | Language specific link for privacy policy on torus-website. See (examples/vue-app) to configure e.g. `privacyPolicy: { en: "http://example.com/tnc/en", ja: "http://example.com/tnc/ja", }` |
diff --git a/src/common/sdk/pnp/web/_switch-chain.mdx b/src/common/sdk/pnp/web/_switch-chain.mdx index 12e075f85..7cad989e2 100644 --- a/src/common/sdk/pnp/web/_switch-chain.mdx +++ b/src/common/sdk/pnp/web/_switch-chain.mdx @@ -15,9 +15,9 @@ To switch the Chain to the added chain config, you need to call `switchChain()` -| Variable | Type | Description | Mandatory | -| ------------------------- | ------ | ---------------------------------------------------------------- | --------- | -| `{ chainId: "0xaa36a7" }` | Object | chainId of the added chain config, e.g `{ chainId: "0xaa36a7" }` | Yes | +| Variable | Description | +| ------------------------- | ---------------------------------------------------------------- | +| `{ chainId: "0xaa36a7" }` | chainId of the added chain config, e.g `{ chainId: "0xaa36a7" }` | diff --git a/src/common/sdk/pnp/web/_ui-config.mdx b/src/common/sdk/pnp/web/_ui-config.mdx index d50e3f4dc..3a570a911 100644 --- a/src/common/sdk/pnp/web/_ui-config.mdx +++ b/src/common/sdk/pnp/web/_ui-config.mdx @@ -11,13 +11,13 @@ import Tabs from "@theme/Tabs"; -| Parameter | Type | Description | Mandatory | Default | -| ----------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `loginMethodsOrder?` | `string[]` | The list of login methods can be reordered with this parameter. Those methods specified will be first on the list. | No | `["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "weibo", "wechat", "email_passwordless"]` | -| `modalZIndex?` | `string` | Z-index of the modal and iframe | No | `"99998"` | -| `displayErrorsOnModal?` | `boolean` | Whether to show errors on Web3Auth modal. | No | `true` | -| `loginGridCol?` | `2` or `3` | Number of columns to display the Social Login buttons. | No | `3` | -| `primaryButton?` | `enum` - (`externalLogin`, `socialLogin` or `emailLogin`) | Decides which button will be displayed as primary button in modal. Only one button will be primary and other buttons in modal will be secondary. | No | `socialLogin` | +| Parameter | Description | +| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `loginMethodsOrder?` | The list of login methods can be reordered with this parameter. Those methods specified will be first on the list. Default value is ["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "weibo", "wechat", "email_passwordless"]. | +| `modalZIndex?` | Z-index of the modal and iframe. The default value is `99998` and accepts a `string` as a value. | +| `displayErrorsOnModal?` | Whether to show errors on Web3Auth modal. Default value is `true`. | +| `loginGridCol?` | Number of columns to display the Social Login buttons. Default value is 3, available options are 2 or 3. | +| `primaryButton?` | Decides which button will be displayed as primary button in modal. Only one button will be primary and other buttons in modal will be secondary. Default value is `socialLogin`. Available options are `externalLogin`, `socialLogin`, and `emailLogin`. | diff --git a/src/common/sdk/pnp/web/_web3auth-options.mdx b/src/common/sdk/pnp/web/_web3auth-options.mdx index 1f650270e..b73f00ae2 100644 --- a/src/common/sdk/pnp/web/_web3auth-options.mdx +++ b/src/common/sdk/pnp/web/_web3auth-options.mdx @@ -11,18 +11,16 @@ import Tabs from "@theme/Tabs"; -| Parameter | Type | Description | Mandatory | Default | -| ------------------ | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------------------------- | -| `chainConfig` | Partial `` & Pick `` | Custom configuration for your preferred blockchain. Read more about it [here](#chainconfig). | Yes | -| `clientId` | `string` | Client ID for web3auth. Obtain your `clientId` from the [Web3Auth Developer Dashboard](https://dashboard.web3auth.io/). | Yes | -| `web3AuthNetwork?` | `OPENLOGIN_NETWORK_TYPE` | Web3Auth Network to use for the session & the issued idToken | No | `mainnet` | -| `authMode?` | `enum` - (`DAPP`, `WALLET`) | Web3Auth instance provides different adapters for different type of usages. If you are a dApp and want to use external wallets like metamask, then you can use the `DAPP` authMode. If you are a wallet and only want to use you own wallet implementations, then you should use `WALLET` authMode. | No | `DAPP` | -| `uiConfig?` | `UIConfig` | Configuration for whitelabeling the Modal UI display properties. Read more about it [here](#uiconfig) | No | Predefined `UIConfig` used | -| `enableLogging?` | `boolean` | Setting to true will enable logs | No | `false` | -| `storageKey?` | `enum` - (`session`, `local`) | Setting to "local" will persist social login session across browser tabs. | No | `local` | -| `sessionTime?` | `number` | sessionTime (in seconds) for idToken issued by Web3Auth for server side verification. Note: max value can be 7 days (86400 \* 7) and min can be 1 day (86400) | No | `86400` | -| `useCoreKitKey?` | `boolean` | Use `useCoreKitKey` as `true`, if you're using this SDK with the Single Factor Auth Web SDK | No | `false` | -| `privateKeyProvider`| `IBaseProvider` | Private key provider for your chain namespace | Yes | | +| Parameter | Description | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `string` | +| `web3AuthNetwork` | Defines the Web3Auth network. It's a mandatory field of type `OPENLOGIN_NETWORK_TYPE`. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | +| `authMode?` | Web3Auth instance provides different adapters for different type of usages. If you are a dApp and want to use external wallets like metamask, then you can use the `DAPP` authMode. If you are a wallet and only want to use you own wallet implementations, then you should use `WALLET` authMode. | +| `uiConfig?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `Omit` as a value. | | +| `storageKey?` | Setting to "local" will persist social login session across browser tabs. | +| `privateKeyProvider` | Private key provider for your chain namespace. It takes `IBaseProvider` as a value. | @@ -88,12 +86,12 @@ interface Web3AuthNoModalOptions { */ useCoreKitKey?: boolean; /** - * WhiteLabel options for web3auth - */ + * WhiteLabel options for web3auth + */ uiConfig?: WhiteLabelData; /** - * Private key provider for your chain namespace - */ + * Private key provider for your chain namespace + */ privateKeyProvider?: IBaseProvider; } ``` diff --git a/src/common/sdk/pnp/web/_web3authcore-options.mdx b/src/common/sdk/pnp/web/_web3authcore-options.mdx index 0028488e4..358b20f09 100644 --- a/src/common/sdk/pnp/web/_web3authcore-options.mdx +++ b/src/common/sdk/pnp/web/_web3authcore-options.mdx @@ -11,17 +11,17 @@ import Tabs from "@theme/Tabs"; -| Parameter | Type | Description | Mandatory | Default | -| --------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | --------- | -| `chainConfig` | Partial `` & Pick `` | Custom configuration for your preferred blockchain. Read more about it [here](#chainconfig). | Yes | -| `clientId` | `string` | Client ID for web3auth. Obtain your `clientId` from the [Web3Auth Developer Dashboard](https://dashboard.web3auth.io/). | Yes | -| `web3AuthNetwork?` | `OPENLOGIN_NETWORK_TYPE` | Web3Auth Network to use for the session & the issued idToken | No | `mainnet` | -| `enableLogging?` | `boolean` | Setting to true will enable logs | No | `false` | -| `storageKey?` | `enum` - (`session`, `local`) | Setting to "local" will persist the social login session across browser tabs. | No | `local` | -| `sessionTime?` | `number` | sessionTime (in seconds) for idToken issued by Web3Auth for server side verification. Note: max value can be 7 days (86400 \* 7) and min can be 1 day (86400) | No | `86400` | -| `useCoreKitKey?` | `boolean` | Use `useCoreKitKey` as `true`, if you're using this SDK with the Single Factor Auth Web SDK | No | `false` | -| `uiConfig?` | `WhiteLabelData` | WhiteLabel options for web3auth | No | | -| `privateKeyProvider?` | `IBaseProvider` | Private key provider for your chain namespace | No | | +| Parameter | Description | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | +| `chainConfig` | Custom configuration for your preferred blockchain. Read more about it [here](#chainconfig). | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `string` | +| `web3AuthNetwork?` | Defines the Web3Auth network. It accepts `OPENLOGIN_NETWORK_TYPE`. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days. | +| `uiConfig?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | | +| `storageKey?` | Setting to "local" will persist social login session across browser tabs. | +| `privateKeyProvider?` | Private key provider for your chain namespace. It takes `IBaseProvider` as a value. | +| `enableLogging` | Setting to true will enable logs. Default value is `false`. | From c4ad90372ad9e7b0d18a17ac6f0c9996405c9370 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Tue, 12 Mar 2024 10:56:37 +0530 Subject: [PATCH 6/9] mention saphire in networks --- docs/sdk/pnp/ios/initialize.mdx | 22 +++++++++++----------- docs/sdk/pnp/react-native/initialize.mdx | 8 -------- docs/sdk/pnp/unity/initialize.mdx | 2 +- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/docs/sdk/pnp/ios/initialize.mdx b/docs/sdk/pnp/ios/initialize.mdx index a85825ab5..aa6f76ea5 100644 --- a/docs/sdk/pnp/ios/initialize.mdx +++ b/docs/sdk/pnp/ios/initialize.mdx @@ -57,14 +57,14 @@ let web3auth = Web3Auth(W3AInitParams( The `Web3Auth` constructor takes an object called `W3AInitParams` as input. Below are the available fields of the `W3AInitParams` object. -| Parameter | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `String` | -| `network` | Defines the Web3Auth network. It's a mandatory field of type Network. | -| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `URL`. | -| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `W3AWhiteLabelData` as a value. | -| `loginConfig?` | Login config for the custom verifiers. It takes Dictonary of `[String: W3ALoginConfig]` as a value. | -| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | -| `chainNamespace?` | Chain Namespace [`eip155` and `solana`]. It takes `ChainNamespace` as a value. | -| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `MfaSettings` as a value. | -| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | +| Parameter | Description | +| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `String` | +| `network` | Defines the Web3Auth network. It's a mandatory field of type Network. Available options `sapphire_mainne`, `sapphire_devnet`, `mainnet`, `cyan`, `aqua`, and `testnet`. | +| `redirectUrl` | URL that Web3Auth will redirect API responses upon successful authentication from browser. It's a mandatory field of type `URL`. | +| `whiteLabel?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `W3AWhiteLabelData` as a value. | +| `loginConfig?` | Login config for the custom verifiers. It takes Dictonary of `[String: W3ALoginConfig]` as a value. | +| `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | +| `chainNamespace?` | Chain Namespace [`eip155` and `solana`]. It takes `ChainNamespace` as a value. | +| `mfaSettings?` | Allows developers to configure the Mfa settings for authentication. It takes `MfaSettings` as a value. | +| `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | diff --git a/docs/sdk/pnp/react-native/initialize.mdx b/docs/sdk/pnp/react-native/initialize.mdx index 9cb835684..fc169ba8e 100644 --- a/docs/sdk/pnp/react-native/initialize.mdx +++ b/docs/sdk/pnp/react-native/initialize.mdx @@ -154,14 +154,6 @@ export type SdkInitParams = { * dapp on {@link "https://dashboard.web3auth.io"| developer dashboard} */ clientId: string; - /** - * network specifies the openlogin sdk url to be used. - * - * - `'mainnet'`: https://app.openlogin.com will be used which is the production version. - * - `'cyan'`: https://cyan.openlogin.com will be used which is the production cyan version. - * - `'testnet'`: https://testing.openlogin.com will be used which is the testing version. - * - `'development'`: http://localhost:3000 will be used for development purpose. - */ network: OPENLOGIN_NETWORK_TYPE; /** * This parameter will be used to change the build environment of openlogin sdk. diff --git a/docs/sdk/pnp/unity/initialize.mdx b/docs/sdk/pnp/unity/initialize.mdx index f2f2e8818..1ea829c28 100644 --- a/docs/sdk/pnp/unity/initialize.mdx +++ b/docs/sdk/pnp/unity/initialize.mdx @@ -106,7 +106,7 @@ The Web3Auth Constructor takes a class `Web3AuthOptions` as input. This class ha ```cs class Web3AuthOptions { string clientId; // Your Web3Auth project ID - public Web3Auth.Network network; // Network to run Web3Auth, either MAINNET, TESTNET, AQUA or CYAN + public Web3Auth.Network network; // Network to run Web3Auth, either SAPPHIRE_MAINNET, SAPPHIRE_DEVNET, MAINNET, TESTNET, AQUA or CYAN public Uri redirectUrl; // URL that Web3Auth will redirect API responses public WhiteLabelData? whiteLabel; // Optional param to configure look public Dictionary loginConfig; // Optional From 6ae95ae8279e17137d49fdfb791ca6359d3e50aa Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Tue, 12 Mar 2024 16:44:33 +0530 Subject: [PATCH 7/9] extract out whitelabel showcase --- .../features/whitelabel/user-flow-screens.mdx | 131 +----------------- docs/sdk/pnp/android/whitelabel.mdx | 6 +- docs/sdk/pnp/flutter/whitelabel.mdx | 6 +- docs/sdk/pnp/ios/whitelabel.mdx | 6 +- docs/sdk/pnp/react-native/whitelabel.mdx | 4 +- docs/sdk/pnp/unity/whitelabel.mdx | 4 +- docs/sdk/pnp/unreal/whitelabel.mdx | 7 +- docs/sdk/pnp/web/modal/whitelabel.mdx | 6 +- docs/sdk/pnp/web/no-modal/whitelabel.mdx | 7 +- src/common/sdk/pnp/_whitelabel_showcase.mdx | 129 +++++++++++++++++ .../pnp/web/_openlogin-whitelabel-config.mdx | 1 - 11 files changed, 165 insertions(+), 142 deletions(-) create mode 100644 src/common/sdk/pnp/_whitelabel_showcase.mdx diff --git a/docs/pnp/features/whitelabel/user-flow-screens.mdx b/docs/pnp/features/whitelabel/user-flow-screens.mdx index 5014fc2dd..ffc4dc805 100644 --- a/docs/pnp/features/whitelabel/user-flow-screens.mdx +++ b/docs/pnp/features/whitelabel/user-flow-screens.mdx @@ -7,6 +7,7 @@ description: "User Flow Screens | Documentation - Web3Auth" import OpenloginWhiteLabelConfig from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx"; import OpenloginWhiteLabelExample from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-example.mdx"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; import Image4 from "@site/static/guides/whitelabel-web3auth-openlogin-dark.png"; import Image7 from "@site/static/guides/whitelabel-web3auth-openlogin-language.png"; import Image3 from "@site/static/guides/whitelabel-web3auth-openlogin-light.png"; @@ -27,135 +28,7 @@ whitelabel the Web3Auth's User Flow Screens. -### `name` - -The name of the application. This will be displayed in the key reconstruction page. - -
-
-

- Standard screen without any change -

- Standard screen without any change -
-
-

- Name changed to Formidable Duo -

- Name changed to Formidable Duo -
-
-
- -### `logoLight` & `logoDark` - -The logo of the application. Displayed in dark and light mode respectively. This will be displayed in the key reconstruction page. - -
-
-

- logoLight on dark mode -

- logoLight on dark mode -
-
-

- logoDark on light mode -

- logoDark on light mode -
-
-
- -### `defaultLanguage` - -Default language will set the language used on all OpenLogin screens. The supported languages are: - -
-
-
    -
  • - en - English (default) -
  • -
  • - de - German -
  • -
  • - ja - Japanese -
  • -
  • - ko - Korean -
  • -
  • - zh - Mandarin -
  • -
  • - es - Spanish -
  • -
  • - fr - French -
  • -
  • - pt - Portuguese -
  • -
  • - nl - Dutch -
  • -
-
-
- default Language screen -
-
-
- -### `dark` - -Can be set to `true` or `false` with default set to `false`. - -
- -
-
-

- For Light: dark: false -

- light theme -
-
-

- For Dark: dark: true -

- dark theme -
-
- -
- -### `theme` - -Theme is a record of colors that can be configured. As of, now only `primary` color can be set and has effect on OpenLogin screens (default primary -color is `#0364FF`). Theme affects icons and links. Examples below. - -
-
-

- Standard color #0364FF -

- Theme is a record of colors that can be configured. -
-
-

- Color changed to #D72F7A -

- Theme affects icons and links. -
-
-
+ ## Example diff --git a/docs/sdk/pnp/android/whitelabel.mdx b/docs/sdk/pnp/android/whitelabel.mdx index a089eea34..5c54f4df4 100644 --- a/docs/sdk/pnp/android/whitelabel.mdx +++ b/docs/sdk/pnp/android/whitelabel.mdx @@ -7,6 +7,7 @@ description: "Web3Auth PnP Android SDK - Whitelabel | Documentation - Web3Auth" import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; For defining custom UI, branding, and translations for your brand, you just need to specify an additional parameter within the `Web3AuthOptions` object called `whiteLabel`. This parameter takes object called `WhiteLabelData`. @@ -61,9 +62,12 @@ data class WhiteLabelData( ``` - + + +### Example + ```kotlin title="Usage" web3Auth = Web3Auth ( Web3AuthOptions ( diff --git a/docs/sdk/pnp/flutter/whitelabel.mdx b/docs/sdk/pnp/flutter/whitelabel.mdx index c7945da74..954ef3c8c 100644 --- a/docs/sdk/pnp/flutter/whitelabel.mdx +++ b/docs/sdk/pnp/flutter/whitelabel.mdx @@ -7,6 +7,7 @@ description: "Web3Auth PnP Flutter SDK - Whitelabel | Documentation - Web3Auth" import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; For defining custom UI, branding, and translations for your brand app, you just need to define an optional object called `WhiteLabelData`. `WhiteLabelData` can be definied during initialization of the SDK in `LoginParams` object. @@ -44,7 +45,6 @@ Plan**. You can use this feature in the development environment for free. | `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are null, the default Web3Auth logo will be used for the loader. Default value is false. | - ```dart @@ -87,6 +87,10 @@ class WhiteLabelData { + + +### Example + ```dart title="Usage" Future initWeb3Auth() async { diff --git a/docs/sdk/pnp/ios/whitelabel.mdx b/docs/sdk/pnp/ios/whitelabel.mdx index f9980dd8d..0d1fc6436 100644 --- a/docs/sdk/pnp/ios/whitelabel.mdx +++ b/docs/sdk/pnp/ios/whitelabel.mdx @@ -7,6 +7,7 @@ description: "Web3Auth PnP iOS SDK - Whitelabel | Documentation - Web3Auth" import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; For defining custom UI, branding, and translations for your brand app, you just need to define an optional object called `W3AWhiteLabelData`. `W3AWhiteLabelData` can be definied during initialization of the SDK in `W3AInitParams` object. @@ -61,9 +62,12 @@ public struct W3AWhiteLabelData: Codable { ``` - + + +### Example + ```swift title="Usage" web3Auth = await Web3Auth( W3AInitParams( diff --git a/docs/sdk/pnp/react-native/whitelabel.mdx b/docs/sdk/pnp/react-native/whitelabel.mdx index 1a2792dea..99ddaa2e7 100644 --- a/docs/sdk/pnp/react-native/whitelabel.mdx +++ b/docs/sdk/pnp/react-native/whitelabel.mdx @@ -7,6 +7,7 @@ description: "Web3Auth PnP React Native SDK - Whitelabel | Documentation - Web3A import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; `whiteLabel` @@ -132,9 +133,10 @@ export type WhiteLabelData = { ``` - + + ### Example - + + ## Example ```cs diff --git a/docs/sdk/pnp/unreal/whitelabel.mdx b/docs/sdk/pnp/unreal/whitelabel.mdx index 3781315dd..5428c4fa5 100644 --- a/docs/sdk/pnp/unreal/whitelabel.mdx +++ b/docs/sdk/pnp/unreal/whitelabel.mdx @@ -7,6 +7,7 @@ description: "Web3Auth PnP Unreal Engine SDK - Whitelabel | Documentation - Web3 import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; For defining custom UI, branding, and translations for your brand app, you just need to specify an additional parameter within the `Web3AuthOptions` class called `whiteLabel`. This parameter takes another object called `WhiteLabelData`. @@ -44,7 +45,6 @@ Plan**. You can use this feature in the development environment for free. | `useLogoLoader?` | Use logo loader. If `logoDark` and `logoLight` are null, the default Web3Auth logo will be used for the loader. Default value is false. | - ```cs @@ -94,9 +94,10 @@ struct FWhiteLabelData ``` - -# Example + + +## Example ![Unreal Whitelabel](/guides/sdk/unreal/unreal-whitelable-data.png) diff --git a/docs/sdk/pnp/web/modal/whitelabel.mdx b/docs/sdk/pnp/web/modal/whitelabel.mdx index 41ca65eca..6fe235a98 100644 --- a/docs/sdk/pnp/web/modal/whitelabel.mdx +++ b/docs/sdk/pnp/web/modal/whitelabel.mdx @@ -6,6 +6,7 @@ description: "Whitelabel Web3Auth | Documentation - Web3Auth" --- import InitModalConfigExample from "@site/src/common/sdk/pnp/web/_init-modal-config-example.mdx"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; import ModalConfig from "@site/src/common/sdk/pnp/web/_modal-config.mdx"; import OpenloginWhiteLabelConfig from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx"; import OpenloginWhiteLabelExample from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-example.mdx"; @@ -21,8 +22,8 @@ Whitelabeling, giving granular customization capability across all our offerings :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -101,6 +102,7 @@ customizations. ::: + ### Example diff --git a/docs/sdk/pnp/web/no-modal/whitelabel.mdx b/docs/sdk/pnp/web/no-modal/whitelabel.mdx index a581e3d42..64d91120b 100644 --- a/docs/sdk/pnp/web/no-modal/whitelabel.mdx +++ b/docs/sdk/pnp/web/no-modal/whitelabel.mdx @@ -6,6 +6,7 @@ description: "Web3Auth PnP Web No Modal SDK - Whitelabel | Documentation - Web3A --- import OpenloginWhiteLabelConfig from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx"; +import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; import OpenloginWhiteLabelExample from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-example.mdx"; import PluginConfig from "@site/src/common/sdk/pnp/web/_plugin-config.mdx"; import PluginWhitelabelConfig from "@site/src/common/sdk/pnp/web/_plugin-whitelabel-config.mdx"; @@ -17,8 +18,8 @@ UI for triggering the login. Further, Whitelabeling enables you to customize the :::note -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 Plan**. You can use this feature in the development environment for free. +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 +Plan**. You can use this feature in the development environment for free. ::: @@ -32,6 +33,8 @@ Within the Web3Auth Plug and Play No Modal SDK, whitelabeling can happen in 2 di + + ## Openlogin Adapter Web3Auth's Social Logins and Email Login run using the OpenLogin Flow. The whole OpenLogin user experience can also be whitelabeled using OpenLogin diff --git a/src/common/sdk/pnp/_whitelabel_showcase.mdx b/src/common/sdk/pnp/_whitelabel_showcase.mdx new file mode 100644 index 000000000..dabe74881 --- /dev/null +++ b/src/common/sdk/pnp/_whitelabel_showcase.mdx @@ -0,0 +1,129 @@ +### `name` + +The name of the application. This will be displayed in the key reconstruction page. + +
+
+

+ Standard screen without any change +

+ Standard screen without any change +
+
+

+ Name changed to Formidable Duo +

+ Name changed to Formidable Duo +
+
+
+ +### `logoLight` & `logoDark` + +The logo of the application. Displayed in dark and light mode respectively. This will be displayed in the key reconstruction page. + +
+
+

+ logoLight on dark mode +

+ logoLight on dark mode +
+
+

+ logoDark on light mode +

+ logoDark on light mode +
+
+
+ +### `defaultLanguage` + +Default language will set the language used on all OpenLogin screens. The supported languages are: + +
+
+
    +
  • + en - English (default) +
  • +
  • + de - German +
  • +
  • + ja - Japanese +
  • +
  • + ko - Korean +
  • +
  • + zh - Mandarin +
  • +
  • + es - Spanish +
  • +
  • + fr - French +
  • +
  • + pt - Portuguese +
  • +
  • + nl - Dutch +
  • +
+
+
+ default Language screen +
+
+
+ +### `dark` + +Can be set to `true` or `false` with default set to `false`. + +
+ +
+
+

+ For Light: dark: false +

+ light theme +
+
+

+ For Dark: dark: true +

+ dark theme +
+
+ +
+ +### `theme` + +Theme is a record of colors that can be configured. As of, now only `primary` color can be set and has effect on OpenLogin screens (default primary +color is `#0364FF`). Theme affects icons and links. Examples below. + +
+
+

+ Standard color #0364FF +

+ Theme is a record of colors that can be configured. +
+
+

+ Color changed to #D72F7A +

+ Theme affects icons and links. +
+
+
diff --git a/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx b/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx index d1411e804..6b68f8044 100644 --- a/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx +++ b/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx @@ -115,5 +115,4 @@ export type WhiteLabelData = { ``` - From 60168883147c855fa726b31c56770a5b19bd4228 Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Tue, 12 Mar 2024 17:16:31 +0530 Subject: [PATCH 8/9] add images --- docs/pnp/features/whitelabel/user-flow-screens.mdx | 7 ------- src/common/sdk/pnp/_whitelabel_showcase.mdx | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/pnp/features/whitelabel/user-flow-screens.mdx b/docs/pnp/features/whitelabel/user-flow-screens.mdx index ffc4dc805..0f1bac87e 100644 --- a/docs/pnp/features/whitelabel/user-flow-screens.mdx +++ b/docs/pnp/features/whitelabel/user-flow-screens.mdx @@ -8,13 +8,6 @@ description: "User Flow Screens | Documentation - Web3Auth" import OpenloginWhiteLabelConfig from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-config.mdx"; import OpenloginWhiteLabelExample from "@site/src/common/sdk/pnp/web/_openlogin-whitelabel-example.mdx"; import WhiteLabelShowcase from "@site/src/common/sdk/pnp/_whitelabel_showcase.mdx"; -import Image4 from "@site/static/guides/whitelabel-web3auth-openlogin-dark.png"; -import Image7 from "@site/static/guides/whitelabel-web3auth-openlogin-language.png"; -import Image3 from "@site/static/guides/whitelabel-web3auth-openlogin-light.png"; -import Image9 from "@site/static/guides/whitelabel-web3auth-openlogin-logo-dark.png"; -import Image8 from "@site/static/guides/whitelabel-web3auth-openlogin-logo-light.png"; -import DashboardImage from "@site/static/guides/whitelabel-web3auth-openlogin-theme1.png"; -import Image6 from "@site/static/guides/whitelabel-web3auth-openlogin-theme2.png"; Web3Auth's User Flow Screens can be customized to match a dApp's branding using the `OpenLoginAdapter` settings, providing more options for a personalized user experience. diff --git a/src/common/sdk/pnp/_whitelabel_showcase.mdx b/src/common/sdk/pnp/_whitelabel_showcase.mdx index dabe74881..5632a8df8 100644 --- a/src/common/sdk/pnp/_whitelabel_showcase.mdx +++ b/src/common/sdk/pnp/_whitelabel_showcase.mdx @@ -1,3 +1,11 @@ +import Image4 from "@site/static/guides/whitelabel-web3auth-openlogin-dark.png"; +import Image7 from "@site/static/guides/whitelabel-web3auth-openlogin-language.png"; +import Image3 from "@site/static/guides/whitelabel-web3auth-openlogin-light.png"; +import Image9 from "@site/static/guides/whitelabel-web3auth-openlogin-logo-dark.png"; +import Image8 from "@site/static/guides/whitelabel-web3auth-openlogin-logo-light.png"; +import DashboardImage from "@site/static/guides/whitelabel-web3auth-openlogin-theme1.png"; +import Image6 from "@site/static/guides/whitelabel-web3auth-openlogin-theme2.png"; + ### `name` The name of the application. This will be displayed in the key reconstruction page. From ac06632cec40bf7f13cb90d608bcb603b453042f Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Thu, 14 Mar 2024 14:02:41 +0530 Subject: [PATCH 9/9] fix table for web3authoptions --- src/common/sdk/pnp/web/_web3auth-options.mdx | 4 ++-- src/common/sdk/pnp/web/_web3authcore-options.mdx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/sdk/pnp/web/_web3auth-options.mdx b/src/common/sdk/pnp/web/_web3auth-options.mdx index b73f00ae2..c1276c77b 100644 --- a/src/common/sdk/pnp/web/_web3auth-options.mdx +++ b/src/common/sdk/pnp/web/_web3auth-options.mdx @@ -12,13 +12,13 @@ import Tabs from "@theme/Tabs"; | Parameter | Description | -| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `string` | | `web3AuthNetwork` | Defines the Web3Auth network. It's a mandatory field of type `OPENLOGIN_NETWORK_TYPE`. | | `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | | `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days | | `authMode?` | Web3Auth instance provides different adapters for different type of usages. If you are a dApp and want to use external wallets like metamask, then you can use the `DAPP` authMode. If you are a wallet and only want to use you own wallet implementations, then you should use `WALLET` authMode. | -| `uiConfig?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `Omit` as a value. | | +| `uiConfig?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `Omit` as a value. | | `storageKey?` | Setting to "local" will persist social login session across browser tabs. | | `privateKeyProvider` | Private key provider for your chain namespace. It takes `IBaseProvider` as a value. | diff --git a/src/common/sdk/pnp/web/_web3authcore-options.mdx b/src/common/sdk/pnp/web/_web3authcore-options.mdx index 358b20f09..4791b937d 100644 --- a/src/common/sdk/pnp/web/_web3authcore-options.mdx +++ b/src/common/sdk/pnp/web/_web3authcore-options.mdx @@ -12,13 +12,13 @@ import Tabs from "@theme/Tabs"; | Parameter | Description | -| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | +| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `chainConfig` | Custom configuration for your preferred blockchain. Read more about it [here](#chainconfig). | | `clientId` | Your Web3Auth Client ID. You can get it from Web3Auth [Dashboard](https://dashboard.web3auth.io/) under project details. It's a mandatory field of type `string` | | `web3AuthNetwork?` | Defines the Web3Auth network. It accepts `OPENLOGIN_NETWORK_TYPE`. | | `useCoreKitKey?` | Use CoreKit Key to get core kit key. It's an optional field with default value as `false`. | | `sessionTime?` | It allows developers to configure the session management time. Session Time is in seconds, default is 86400 seconds which is 1 day. `sessionTime` can be max 7 days. | -| `uiConfig?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | | +| `uiConfig?` | WhiteLabel options for web3auth. It helps you define custom UI, branding, and translations for your brand app. It takes `WhiteLabelData` as a value. | | `storageKey?` | Setting to "local" will persist social login session across browser tabs. | | `privateKeyProvider?` | Private key provider for your chain namespace. It takes `IBaseProvider` as a value. | | `enableLogging` | Setting to true will enable logs. Default value is `false`. |