Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK v10 - integrate with project config from Dashboard #2099

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

tanguyenvn
Copy link
Contributor

@tanguyenvn tanguyenvn commented Mar 21, 2025

Motivation and Context

Jira Link:

Description

Use the following config from dashboard project configuration: (!!!Config from code should take precedence)

  • Chains
  • Login config:
    • external wallet logins
    • social logins
    • email_passwordless login
    • sms_passwordless login
    • passkeys login
  • Smart Accounts (WIP)

Mock data

projectConfig = {
       // CHAINS
        chains: {
          "0x1": {
            enabled: true,
            config: getChainConfig("eip155", "0x1", this.options.clientId),
          },
          "0x65": {
            enabled: true,
            config: getChainConfig("solana", "0x65", this.options.clientId),
          },
          "0x67": {
            enabled: false,
            config: getChainConfig("solana", "0x67", this.options.clientId),
          },
        },
        externalWalletLogin: {
          enabled: true,
          config: {
            metamask: { enabled: true },
            phantom: { enabled: false },
            trust: { enabled: false },
          },
        },
        socialLogin: {
          [LOGIN_PROVIDER.GOOGLE]: {
            enabled: true,
            config: {
              verifier: "web3auth-jwt-verifier",
              clientId: "taiclientId",
              typeOfLogin: "jwt",
              jwtParameters: {
                domain: "https://tai.web3auth.io",
              },
              showOnModal: true,
              showOnDesktop: true,
              showOnMobile: true,
              showOnSocialBackupFactor: true,
              mainOption: true,
              name: "Google",
            },
          },
          [LOGIN_PROVIDER.FACEBOOK]: {
            enabled: false,
          },
        },
        emailPasswordlessLogin: {
          enabled: true,
          config: {
            verifier: "web3auth-jwt-verifier",
            clientId: "taiclientId",
            typeOfLogin: "jwt",
            jwtParameters: {
              domain: "https://tai.web3auth.io",
            },
            showOnModal: true,
            showOnDesktop: true,
            showOnMobile: true,
            showOnSocialBackupFactor: true,
            mainOption: true,
            name: "Email",
          },
        },
        smsPasswordlessLogin: {
          enabled: true,
          config: {
            verifier: "web3auth-jwt-verifier",
            clientId: "taiclientId",
            typeOfLogin: "jwt",
            jwtParameters: {
              domain: "https://tai.web3auth.io",
            },
            showOnModal: true,
            showOnDesktop: true,
            showOnMobile: true,
            showOnSocialBackupFactor: true,
            mainOption: true,
            name: "Email",
          },
        },
        passkeysLogin: { enabled: false },
        smartAccounts: {
          enabled: false,
          config: {
            walletScope: "all",
            smartAccountType: "safe",
            chains: {
              "0xaa36a7": {
                bundlerConfig: {
                  url: "https://api.pimlico.io/v2/11155111/rpc?apikey=pim_9ZMPA69qJ1BP19kt3Pi3Ro",
                },
              },
              // "0x1": {
              //   bundlerConfig: {
              //     url: "https://api.pimlico.io/v2/1/rpc?apikey=pim_9ZMPA69qJ1BP19kt3Pi3Ro",
              //   },
              // },
            },
          },
        },
      };

How has this been tested?

Screenshots (if appropriate):

###Part 1: CHAINS

  • When chains configured in dashboard and in code, we'll merge and code will take precedence
image

###Part 2: Login Config

  • When no login config is enabled (including external_wallets, social logins...)
image

EXTERNAL WALLETS

  • When only external_wallets is enabled in project config, no specific wallets are disabled
image
  • When only external_wallets is enabled in project config, metamask is enabled but phantom and trust are disabled
image

SOCIAL LOGIN & OTHERS

  • When Google is enabled, Facebook is disabled in project config
image
  • When both Google and Facebook are disabled in project config
image
  • When Google is disabled in project config but enabled in code, code will take precedence
image

###Part3: Smart Accounts

  • Allow specifying AA config for multiple chains
    image
    image
  • When passing multiple chains and account abstraction config for some chains, it'll filter out non AA-supported chains. It'll allow Solana but won't setup AA provider
    image
    image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

Copy link

vercel bot commented Mar 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3auth-web ❌ Failed (Inspect) Mar 24, 2025 6:33am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant