From 01a059f65fddf1b157fd447480a017dddffd0afe Mon Sep 17 00:00:00 2001 From: Maharshi Mishra Date: Fri, 3 May 2024 11:21:56 +0800 Subject: [PATCH 1/9] Added KaKao to the sidebar --- sidebars.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sidebars.ts b/sidebars.ts index 62c756a60..6d0a902af 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -235,6 +235,7 @@ const sidebars: SidebarsConfig = { "auth-provider-setup/social-providers/twitch", "auth-provider-setup/social-providers/discord", "auth-provider-setup/social-providers/apple", + "auth-provider-setup/social-providers/kakao", "auth-provider-setup/social-providers/linkedin", "auth-provider-setup/social-providers/github", "auth-provider-setup/social-providers/line", From b212c7c752c46f3e76cd834b22df66dcc510be04 Mon Sep 17 00:00:00 2001 From: Maharshi Mishra Date: Mon, 6 May 2024 10:35:21 +0800 Subject: [PATCH 2/9] minor fix to SFA web docs --- docs/sdk/core-kit/sfa-web/initialize.mdx | 4 ++-- docs/sdk/core-kit/sfa-web/install.mdx | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/sdk/core-kit/sfa-web/initialize.mdx b/docs/sdk/core-kit/sfa-web/initialize.mdx index ca6a8060f..3a7d85e99 100644 --- a/docs/sdk/core-kit/sfa-web/initialize.mdx +++ b/docs/sdk/core-kit/sfa-web/initialize.mdx @@ -64,7 +64,7 @@ web3auth.init(privateKeyProvider); ```javascript import { Web3Auth } from "@web3auth/single-factor-auth"; import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider"; -import { CHAIN_NAMESPACES } from "@web3auth/base"; +import { CHAIN_NAMESPACES, WEB3AUTH_NETWORK } from "@web3auth/base"; // Swap with a different provider if you want to use a different blockchain const privateKeyProvider = new EthereumPrivateKeyProvider({ @@ -83,7 +83,7 @@ const privateKeyProvider = new EthereumPrivateKeyProvider({ const web3auth = new Web3Auth({ clientId: "WEB3AUTH_CLIENT_ID", // Get your Client ID from the Web3Auth Dashboard - web3AuthNetwork: "sapphire_mainnet", + web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET, usePnPKey: false, // By default, this SDK returns CoreKitKey by default. }); diff --git a/docs/sdk/core-kit/sfa-web/install.mdx b/docs/sdk/core-kit/sfa-web/install.mdx index 4b68ee653..12d48c63f 100644 --- a/docs/sdk/core-kit/sfa-web/install.mdx +++ b/docs/sdk/core-kit/sfa-web/install.mdx @@ -11,6 +11,12 @@ description: "Web3Auth Core Kit Single Factor Auth Web SDK - Install | Documenta npm install --save @web3auth/single-factor-auth ``` +## [`@web3auth/ethereum-provider`](https://npmjs.com/package/@web3auth/ethereum-provider) + +```bash npm2yarn +npm install --save @web3auth/ethereum-provider +``` + ## Consider adding `@web3auth/base` to your project ```bash npm2yarn From bd8ba8d86328f90976e3fde16aeb4783dba58bc0 Mon Sep 17 00:00:00 2001 From: Yashovardhan Agrawal Date: Mon, 6 May 2024 12:27:03 +0800 Subject: [PATCH 3/9] Add webgl build for unity --- src/pages/quick-start/builder/choices.ts | 4 +++- src/pages/quick-start/builder/index.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/quick-start/builder/choices.ts b/src/pages/quick-start/builder/choices.ts index 47d787a55..d5e216ed2 100644 --- a/src/pages/quick-start/builder/choices.ts +++ b/src/pages/quick-start/builder/choices.ts @@ -33,6 +33,7 @@ export const ANGULAR = "ANGULAR"; export const HTML = "HTML"; export const ANDROID = "ANDROID"; export const IOS = "IOS"; +export const WEBGL = "WEBGL"; export const REACT_NATIVE = "REACT_NATIVE"; export const FLUTTER = "FLUTTER"; export const UNITY = "UNITY"; @@ -77,6 +78,7 @@ export const LANGS_WEB_MPC_CORE_KIT: DisplayChoice[] = [ const android = { key: ANDROID, displayName: "Android" }; const ios = { key: IOS, displayName: "iOS/Swift" }; +const webgl = { key: WEBGL, displayName: "WebGL" }; export const LANGS_ANDROID: DisplayChoice[] = [android]; @@ -86,7 +88,7 @@ export const LANGS_REACT_NATIVE: DisplayChoice[] = [ios, android]; export const LANGS_FLUTTER: DisplayChoice[] = [android, ios]; -export const LANGS_UNITY: DisplayChoice[] = [android, ios]; +export const LANGS_UNITY: DisplayChoice[] = [android, ios, webgl]; export const LANGS_NODE: DisplayChoice[] = [{ key: NODE, displayName: "NodeJS" }]; diff --git a/src/pages/quick-start/builder/index.ts b/src/pages/quick-start/builder/index.ts index e5df8a6e0..acf46a5f0 100644 --- a/src/pages/quick-start/builder/index.ts +++ b/src/pages/quick-start/builder/index.ts @@ -83,6 +83,7 @@ const sdks = { // PNP Unity SDK PNP_UNITY_ANDROID: pnp_unity, PNP_UNITY_IOS: pnp_unity, + PNP_UNITY_WEBGL: pnp_unity, // SFA Web SDK SFA_WEB_ANGULAR: sfa_web_angular, SFA_WEB_NEXTJS: sfa_web_nextjs, @@ -135,6 +136,7 @@ const embed_links = { // PNP Unity SDK PNP_UNITY_ANDROID: "https://w3a.link/pnp-unity-android-quick-start", PNP_UNITY_IOS: "", // "https://w3a.link/pnp-unity-ios-quick-start" + PNP_UNITY_WEBGL: "https://w3a.link/pnp-unity-webgl-quick-start", // SFA Web SDK SFA_WEB_ANGULAR: "https://w3a.link/sfa-angular-quick-start", SFA_WEB_NEXTJS: "https://w3a.link/sfa-nextjs-quick-start", From 7f2a86ca484edde86cc5256fcdb4299af052ca14 Mon Sep 17 00:00:00 2001 From: Yashovardhan Agrawal Date: Tue, 7 May 2024 12:56:50 +0800 Subject: [PATCH 4/9] Add condition to preview unity webgl example in a separate tab --- src/pages/quick-start/builder/index.ts | 2 +- src/pages/quick-start/index.tsx | 103 ++++++++++++++++++++----- 2 files changed, 84 insertions(+), 21 deletions(-) diff --git a/src/pages/quick-start/builder/index.ts b/src/pages/quick-start/builder/index.ts index acf46a5f0..7c02eb49a 100644 --- a/src/pages/quick-start/builder/index.ts +++ b/src/pages/quick-start/builder/index.ts @@ -110,7 +110,7 @@ const sdks = { MPC_CORE_KIT_REACT_NATIVE: mpc_core_kit_react_native, }; -const embed_links = { +export const embed_links = { // PNP Modal SDK PNP_MODAL_ANGULAR: "https://w3a.link/pnp-angular-modal-quick-start", PNP_MODAL_HTML: "https://w3a.link/pnp-vanillajs-modal-quick-start", diff --git a/src/pages/quick-start/index.tsx b/src/pages/quick-start/index.tsx index 388150e56..b0b1aa24a 100644 --- a/src/pages/quick-start/index.tsx +++ b/src/pages/quick-start/index.tsx @@ -12,7 +12,7 @@ import MoonLoader from "react-spinners/BeatLoader"; import SEO from "../../components/SEO"; import IntegrationBuilderCodeView from "../../theme/IntegrationBuilderCodeView"; -import builder from "./builder"; +import builder, { embed_links } from "./builder"; import { CORE_KIT, PNP } from "./builder/choices"; import styles from "./styles.module.css"; @@ -22,7 +22,9 @@ const getWindowLocation = () => { }; const getDefaultBuilderOptions = () => { - const defaultOpts = Object.fromEntries(Object.entries(builder.options).map(([key, option]) => [key, option.default])); + const defaultOpts = Object.fromEntries( + Object.entries(builder.options).map(([key, option]) => [key, option.default]), + ); const url = new URL(getWindowLocation()); const urlOpts = {}; @@ -41,14 +43,21 @@ const getURLFromBuilderOptions = (opts: Record, stepIndex): stri }; export default function IntegrationBuilderPage({ files }: { files: Record }) { - const [builderOptions, setBuilderOptions] = useState>(getDefaultBuilderOptions()); + const [builderOptions, setBuilderOptions] = useState>( + getDefaultBuilderOptions(), + ); const [isLinkCopied, setLinkCopied] = useState(false); const [builderView, setBuilderView] = useState(true); const [showPreviewModal, setShowPreviewModal] = useState(false); const url = new URL(getWindowLocation()); - const [stepIndex, setStepIndex] = useState(parseInt(url.searchParams.get("stepIndex") || "0", 10)); + const [stepIndex, setStepIndex] = useState( + parseInt(url.searchParams.get("stepIndex") || "0", 10), + ); const [loading, setLoading] = useState(false); - const integration = useMemo(() => builder.build(builderOptions, files, stepIndex), [builderOptions, files, stepIndex]); + const integration = useMemo( + () => builder.build(builderOptions, files, stepIndex), + [builderOptions, files, stepIndex], + ); const [selectedFilename, setSelectedFilename] = useState(integration.filenames[0]); const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); @@ -117,7 +126,11 @@ export default function IntegrationBuilderPage({ files }: { files: Record { + const togglePreviewModal = (link?: string) => { + if (link === embed_links.PNP_UNITY_WEBGL) { + window.open(link, "_blank"); + return; + } if (showPreviewModal) { setShowPreviewModal(false); } else { @@ -135,7 +148,9 @@ export default function IntegrationBuilderPage({ files }: { files: Record choice.key); if (!check.includes(builderOptions[optionKey])) { - const option = Object.fromEntries(Object.entries(builder.options).map(([key, optioning]) => [key, optioning.default])); + const option = Object.fromEntries( + Object.entries(builder.options).map(([key, optioning]) => [key, optioning.default]), + ); onChangeDropdown(optionKey, option[optionKey]); } } @@ -157,7 +172,10 @@ export default function IntegrationBuilderPage({ files }: { files: Record

{option.displayName}

- onChangeDropdown(key, event.target.value)} + > {option.choices.map((value) => (