diff --git a/docs/pnp/migration-guides/modal-v5-to-v6.mdx b/docs/pnp/migration-guides/modal-v5-to-v6.mdx index 53a8b3e3e..e0c59e514 100644 --- a/docs/pnp/migration-guides/modal-v5-to-v6.mdx +++ b/docs/pnp/migration-guides/modal-v5-to-v6.mdx @@ -2,6 +2,7 @@ title: PnP Modal SDK - v5 to v6 displayed_sidebar: docs description: "PnP Modal SDK - v5 to v6 | Documentation - Web3Auth" +sidebar_label: v5 to v6 --- ## General diff --git a/docs/pnp/migration-guides/modal-v6-to-v7.mdx b/docs/pnp/migration-guides/modal-v6-to-v7.mdx index be4633164..fccd557bc 100644 --- a/docs/pnp/migration-guides/modal-v6-to-v7.mdx +++ b/docs/pnp/migration-guides/modal-v6-to-v7.mdx @@ -2,88 +2,67 @@ title: PnP Modal SDK - v6 to v7 displayed_sidebar: docs description: "PnP Modal SDK - v6 to v7 | Documentation - Web3Auth" +sidebar_label: v6 to v7 --- ## General -### `IProvider` is introduced at @web3auth/base +### `web3auth.connect()` now returns a provider of type `IProvider` -#### set web3auth provider type as `IProvider` instead of `SafeEventEmitterProvider` +#### The new provider object now works with the latest version of `web3.js`. -With V7, users can manage their web3auth provider using `IProvider` instead of `SafeEventEmitterProvider`. If `SafeEventEmitterProvider` compatible -with your existing example, there's nothing wrong with using it. +With V7, the type for the provider has been changed to `IProvider` which is compatible with the latest version of `web3.js` instead of the old type +`SafeEventEmitterProvider`. The type `Iprovider` can be imported from the `@web3auth/base` package. ```tsx // With V7 // highlight-start -const [provider, setProvider] = useState(null); +connect(): Promise; // highlight-end ``` -### TypeError: Cannot read properties of undefined (reading 'defaultLanguage') +### -In V6, we could initialize Web3Auth without uiConfig. However in V7, if you encounter this kind of problem, this is because you initialized web3auth -without uiConfig +## OpenLoginAdapter -```tsx -// With V6 -const web3auth = new Web3Auth({ - clientId, - chainConfig: { - chainNamespace: CHAIN_NAMESPACES.EIP155, - chainId: "0x1", - rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app - }, - web3AuthNetwork: "cyan", -}); -// With V7 -const web3auth = new Web3Auth({ - clientId, - chainConfig: { - chainNamespace: CHAIN_NAMESPACES.EIP155, - chainId: "0x1", - rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app - }, - // add uiConfig - // highlight-start - uiConfig: { - appName: "W3A", - // appLogo: "https://web3auth.io/images/w3a-L-Favicon-1.svg", // Your App Logo Here - theme: { - primary: "red", - }, - mode: "dark", - logoLight: "https://web3auth.io/images/w3a-L-Favicon-1.svg", - logoDark: "https://web3auth.io/images/w3a-D-Favicon-1.svg", - defaultLanguage: "en", // en, de, ja, ko, zh, es, fr, pt, nl - loginGridCol: 3, - primaryButton: "externalLogin", // "externalLogin" | "socialLogin" | "emailLogin" - }, - // highlight-end +### Change in the naming of some whitelabel parameters for `OpenLoginAdapter` - web3AuthNetwork: "cyan", -}); -``` +#### `name` and `url` are now `appName` and `appUrl`, respectively. + +In `adapterSettings`, the `whitelabel` object now accepts `appName` and `appUrl` instead of `name` and `url`, respectively. This is done to bring +consistency to the naming convention. -### `rpcTarget` and `chainId` is now a mandatory parameter +#### Light and dark mode is now toggled by the `mode` parameter instead of `dark`. -Previously, the Web Modal SDK required `chainConfig` as a parameter which had `rpcTarget` & `chainId` as the optional parameter. But with V6, it's -mandatory to add `rpcTarget` & `chainId` in the `chainConfig` object. +`mode` accepts a string from the following options: `auto`, `light` or `dark`. This replaces the `dark` boolean parameter from previous versions. ```tsx -const web3auth = new Web3Auth({ - clientId, - chainConfig: { - chainNamespace: CHAIN_NAMESPACES.EIP155, - // highlight-start - chainId: "0x1", - rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own custom endpoint while creating an app - // highlight-end +const openloginAdapter = new OpenloginAdapter({ + adapterSettings: { + whiteLabel: { + // highlight-start + appName: "W3A Heroes", + appUrl: "https://web3auth.io", + // highlight-end + logoLight: "https://web3auth.io/images/w3a-L-Favicon-1.svg", + logoDark: "https://web3auth.io/images/w3a-D-Favicon-1.svg", + defaultLanguage: "en", // en, de, ja, ko, zh, es, fr, pt, nl + // highlight-next-line + mode: "auto", // whether to enable dark mode. defaultValue: false + theme: { + primary: "#768729", + }, + useLogoLoader: true, + }, }, - web3AuthNetwork: "cyan", + privateKeyProvider, }); ``` +## Other changes + +### Extra parameters for `solana-provider` and `xrpl-provider` + #### For Solana For Solana, SolanaWallet in package "@web3auth/solana-provider", the request typings require both input and output now use `string[]` when input diff --git a/docs/pnp/migration-guides/no-modal-v5-to-v6.mdx b/docs/pnp/migration-guides/no-modal-v5-to-v6.mdx index f54be5f15..e62818362 100644 --- a/docs/pnp/migration-guides/no-modal-v5-to-v6.mdx +++ b/docs/pnp/migration-guides/no-modal-v5-to-v6.mdx @@ -2,6 +2,7 @@ title: PnP No Modal SDK - v5 to v6 displayed_sidebar: docs description: "PnP No Modal SDK - v5 to v6 | Documentation - Web3Auth" +sidebar_label: v5 to v6 --- ## General diff --git a/docs/pnp/migration-guides/no-modal-v6-to-v7.mdx b/docs/pnp/migration-guides/no-modal-v6-to-v7.mdx index b836332ff..a137a74c8 100644 --- a/docs/pnp/migration-guides/no-modal-v6-to-v7.mdx +++ b/docs/pnp/migration-guides/no-modal-v6-to-v7.mdx @@ -2,6 +2,7 @@ title: PnP No Modal SDK - v6 to v7 displayed_sidebar: docs description: "PnP No Modal SDK - v6 to v7 | Documentation - Web3Auth" +sidebar_label: v6 to v7 --- ## General @@ -47,11 +48,48 @@ const openloginAdapter = new OpenloginAdapter({ // highlight-next-line mode: "auto", // whether to enable dark mode. defaultValue: false theme: { - primary: "#768729", + primary: "#768729", }, useLogoLoader: true, - } + }, }, privateKeyProvider, }); ``` + +## Other changes + +### Extra parameters for `solana-provider` and `xrpl-provider` + +#### For Solana + +For Solana, SolanaWallet in package "@web3auth/solana-provider", the request typings require both input and output now use `string[]` when input +placeholder is needed + +```tsx +// With V7 +const connectionConfig = await solanaWallet.request({ + method: "solana_provider_config", + params: [], +}); +const conn = new Connection(connectionConfig.rpcTarget); +``` + +#### For XRPL + +For XRPL, after the change of "@web3auth/xrpl-provider" version to v7, the request typings require both input and output now so use `never` when input +or output placeholder is needed + +```tsx +// With V7 +const txSign = await this.provider.request<{ signature: string }, never>({ + method: "xrpl_signMessage", + params: { + signature: hexMsg, + }, +}); + +const accounts = await this.provider.request({ + method: "xrpl_getAccounts", +}); +``` diff --git a/sidebars.js b/sidebars.js index 1ed38b8ce..d2e7ca7e9 100644 --- a/sidebars.js +++ b/sidebars.js @@ -26,9 +26,9 @@ module.exports = { "infrastructure/nodes-and-dkg", "infrastructure/glossary", { - type: 'link', - label: 'Compliance, Audits and Trust', // The link label - href: 'https://trust.web3auth.io', // The external URL + type: "link", + label: "Compliance, Audits and Trust", // The link label + href: "https://trust.web3auth.io", // The external URL }, ], }, @@ -100,12 +100,23 @@ module.exports = { type: "category", label: "Migration Guides", items: [ - "pnp/migration-guides/modal-v5-to-v6", - "pnp/migration-guides/modal-v6-to-v7", - "pnp/migration-guides/no-modal-v5-to-v6", - "pnp/migration-guides/no-modal-v6-to-v7", - "pnp/migration-guides/rn-v3-to-v4" - ] + { + type: "category", + label: "PnP Web Modal", + collapsed: true, + collapsible: true, + items: ["pnp/migration-guides/modal-v6-to-v7", "pnp/migration-guides/modal-v5-to-v6"], + }, + { + type: "category", + label: "PnP Web No Modal", + collapsed: true, + collapsible: true, + items: ["pnp/migration-guides/no-modal-v6-to-v7", "pnp/migration-guides/no-modal-v5-to-v6"], + }, + + "pnp/migration-guides/rn-v3-to-v4", + ], }, // Core Kit Section { @@ -157,7 +168,6 @@ module.exports = { "auth-provider-setup/social-providers/line", "auth-provider-setup/social-providers/weibo", "auth-provider-setup/social-providers/kakao", - ], collapsible: true, collapsed: false, @@ -261,12 +271,16 @@ module.exports = { href: "/sdk", }, { - Legal: ["legal/cookie-policy", "legal/privacy-policy", "legal/terms-and-conditions", + Legal: [ + "legal/cookie-policy", + "legal/privacy-policy", + "legal/terms-and-conditions", { - type: 'link', - label: 'Trust Center', // The link label - href: 'https://trust.web3auth.io', // The external URL - },], + type: "link", + label: "Trust Center", // The link label + href: "https://trust.web3auth.io", // The external URL + }, + ], }, ], sdk: [ @@ -345,9 +359,9 @@ module.exports = { }, "sdk/pnp/web/wagmi-connector", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-web/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-web/releases", // The external URL }, ], }, @@ -364,17 +378,12 @@ module.exports = { collapsible: true, collapsed: false, label: "Additional Settings", - items: [ - "sdk/pnp/android/whitelabel", - "sdk/pnp/android/custom-authentication", - "sdk/pnp/android/mfa", - "sdk/pnp/android/dapp-share", - ], + items: ["sdk/pnp/android/whitelabel", "sdk/pnp/android/custom-authentication", "sdk/pnp/android/mfa", "sdk/pnp/android/dapp-share"], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-android-sdk/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-android-sdk/releases", // The external URL }, ], }, @@ -391,17 +400,12 @@ module.exports = { collapsible: true, collapsed: false, label: "Additional Settings", - items: [ - "sdk/pnp/ios/whitelabel", - "sdk/pnp/ios/custom-authentication", - "sdk/pnp/ios/mfa", - "sdk/pnp/ios/dapp-share", - ], + items: ["sdk/pnp/ios/whitelabel", "sdk/pnp/ios/custom-authentication", "sdk/pnp/ios/mfa", "sdk/pnp/ios/dapp-share"], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-swift-sdk/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-swift-sdk/releases", // The external URL }, ], }, @@ -426,9 +430,9 @@ module.exports = { ], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-react-native-sdk/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-react-native-sdk/releases", // The external URL }, ], }, @@ -445,17 +449,12 @@ module.exports = { collapsible: true, collapsed: false, label: "Additional Settings", - items: [ - "sdk/pnp/flutter/whitelabel", - "sdk/pnp/flutter/custom-authentication", - "sdk/pnp/flutter/mfa", - "sdk/pnp/flutter/dapp-share", - ], + items: ["sdk/pnp/flutter/whitelabel", "sdk/pnp/flutter/custom-authentication", "sdk/pnp/flutter/mfa", "sdk/pnp/flutter/dapp-share"], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-flutter-sdk/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-flutter-sdk/releases", // The external URL }, ], }, @@ -472,17 +471,12 @@ module.exports = { collapsible: true, collapsed: false, label: "Additional Settings", - items: [ - "sdk/pnp/unity/whitelabel", - "sdk/pnp/unity/custom-authentication", - "sdk/pnp/unity/mfa", - "sdk/pnp/unity/dapp-share", - ], + items: ["sdk/pnp/unity/whitelabel", "sdk/pnp/unity/custom-authentication", "sdk/pnp/unity/mfa", "sdk/pnp/unity/dapp-share"], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-unity-sdk/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-unity-sdk/releases", // The external URL }, ], }, @@ -499,16 +493,12 @@ module.exports = { collapsible: true, collapsed: false, label: "Additional Settings", - items: [ - "sdk/pnp/unreal/whitelabel", - "sdk/pnp/unreal/custom-authentication", - "sdk/pnp/unreal/mfa", - ], + items: ["sdk/pnp/unreal/whitelabel", "sdk/pnp/unreal/custom-authentication", "sdk/pnp/unreal/mfa"], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-unreal-sdk/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-unreal-sdk/releases", // The external URL }, ], }, @@ -525,7 +515,7 @@ module.exports = { "sdk/core-kit/mpc-core-kit/install", "sdk/core-kit/mpc-core-kit/initialize", "sdk/core-kit/mpc-core-kit/authentication", - "sdk/core-kit/mpc-core-kit/usage" + "sdk/core-kit/mpc-core-kit/usage", ], }, { @@ -558,15 +548,13 @@ module.exports = { label: "Additional Reading", collapsible: true, collapsed: false, - items: [ - "sdk/core-kit/tkey/intrinsic-flow", - ], + items: ["sdk/core-kit/tkey/intrinsic-flow"], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/tkey/tkey/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/tkey/tkey/releases", // The external URL }, ], }, @@ -591,9 +579,9 @@ module.exports = { ], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/tkey/tkey-ios/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/tkey/tkey-ios/releases", // The external URL }, ], }, @@ -618,9 +606,9 @@ module.exports = { ], }, { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/tkey/tkey-android/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/tkey/tkey-android/releases", // The external URL }, ], }, @@ -640,9 +628,9 @@ module.exports = { "sdk/core-kit/sfa-web/authentication", "sdk/core-kit/sfa-web/usage", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/web3auth/single-factor-auth-web/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/web3auth/single-factor-auth-web/releases", // The external URL }, ], }, @@ -656,9 +644,9 @@ module.exports = { "sdk/core-kit/sfa-node/authentication", "sdk/core-kit/sfa-node/usage", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/web3auth/web3auth-backend/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/web3auth/web3auth-backend/releases", // The external URL }, ], }, @@ -672,9 +660,9 @@ module.exports = { "sdk/core-kit/sfa-android/authentication", "sdk/core-kit/sfa-android/usage", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/web3auth/single-factor-auth-android/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/web3auth/single-factor-auth-android/releases", // The external URL }, ], }, @@ -688,9 +676,9 @@ module.exports = { "sdk/core-kit/sfa-ios/authentication", "sdk/core-kit/sfa-ios/usage", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/web3auth/single-factor-auth-swift/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/web3auth/single-factor-auth-swift/releases", // The external URL }, ], }, @@ -702,7 +690,7 @@ module.exports = { "sdk/core-kit/sfa-react-native/install", "sdk/core-kit/sfa-react-native/initialize", "sdk/core-kit/sfa-react-native/authentication", - "sdk/core-kit/sfa-react-native/usage" + "sdk/core-kit/sfa-react-native/usage", ], }, { @@ -715,9 +703,9 @@ module.exports = { "sdk/core-kit/sfa-flutter/authentication", "sdk/core-kit/sfa-flutter/usage", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/web3auth/single-factor-auth-flutter/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/web3auth/single-factor-auth-flutter/releases", // The external URL }, ], }, @@ -738,9 +726,9 @@ module.exports = { "sdk/helper-sdks/providers/xrpl", "sdk/helper-sdks/providers/common", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-web/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-web/releases", // The external URL }, ], }, @@ -752,9 +740,9 @@ module.exports = { "sdk/helper-sdks/plugins/evm-wallet", "sdk/helper-sdks/plugins/solana-wallet", { - type: 'link', - label: 'Release Notes', // The link label - href: 'https://github.com/Web3Auth/web3auth-web/releases', // The external URL + type: "link", + label: "Release Notes", // The link label + href: "https://github.com/Web3Auth/web3auth-web/releases", // The external URL }, ], },