npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

timeleap-web3-onboard-web3auth

v2.2.4

Published

Web3Auth SDK wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic moder

Downloads

4

Readme

@web3-onboard/web3auth

Wallet module for connecting Web3auth to web3-onboard

Install

npm i @web3-onboard/core @web3-onboard/web3auth

Options

See the Web3auth Docs for the extensive list of options. For troubleshooting web3Auth errors, framework, polyfill, etc please see the official Web3Auth troubleshooting docs.

Usage

import Onboard from '@web3-onboard/core'
import web3authModule from '@web3-onboard/web3auth'

const web3auth = web3authModule({
  clientId:
    'DJuUOKvmNnlzy6ruVgeWYWIMKLRyYtjYa9Y10VCeJzWZcygDlrYLyXsBQjpJ2hxlBO9dnl8t9GmAC2qOP5vnIGo'
})

const onboard = Onboard({
  // ... other Onboard options
  wallets: [
    web3auth
    //... other wallets
  ]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)

Types

type Web3AuthModuleOptions = Omit<Web3AuthOptions, 'chainConfig'> & {
  chainConfig?: Partial<CustomChainConfig> &
    Pick<CustomChainConfig, 'chainNamespace'>

  modalConfig?: Record<string, ModalConfig> | undefined

  /**
   * @deprecated use web3Auth native Z-Index config through
   * uiConfig.modalZIndex
   */
  loginModalZIndex?: string
}

interface Web3AuthOptions extends Web3AuthNoModalOptions {
    /**
     * 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 along with openlogin,
     * then you should use `WALLET` authMode.
     *
     * @defaultValue `DAPP`
     */
    authMode?: "DAPP" | "WALLET";
    /**
     * Config for configuring modal ui display properties
     */
    uiConfig?: Omit<UIConfig, "adapterListener">;
}

interface UIConfig {
    /**
     * App name to display in the UI.
     */
    appName?: string;
    /**
     * Logo for your app.
     */
    appLogo?: string;
    /**
     * theme for the modal
     *
     * @defaultValue `auto`
     */
    theme?: "light" | "dark" | "auto";
    /**
     * order of how login methods are shown
     *
     * @defaultValue `["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "weibo", "wechat", "email_passwordless"]`
     */
    loginMethodsOrder?: string[];
    /**
     * language which will be used by web3auth. app will use browser language if not specified. if language is not supported it will use "en"
     * en: english
     * de: german
     * ja: japanese
     * ko: korean
     * zh: mandarin
     * es: spanish
     * fr: french
     * pt: portuguese
     *
     */
    defaultLanguage?: string;
    /**
     * Z-index of the modal and iframe
     * @defaultValue 99998
     */
    modalZIndex?: string;
    /**
     * Whether to show errors on Web3Auth modal.
     *
     * @defaultValue `true`
     */
    displayErrorsOnModal?: boolean;
    /**
     * number of columns to display the Social Login buttons
     *
     * @defaultValue `3`
     */
    loginGridCol?: 2 | 3;
    /**
     * 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
     *
     * @defaultValue `socialLogin`
     */
    primaryButton?: "externalLogin" | "socialLogin" | "emailLogin";
    adapterListener: SafeEventEmitter;
    web3AuthNetwork?: OPENLOGIN_NETWORK_TYPE;
}

Build Environments

For troubleshooting web3Auth build env troubleshooting please also see the official Web3Auth troubleshooting docs.

Webpack 4

Node built-ins are automatically bundled in v4 so that portion is handled automatically.

web3auth will require a Babel to compile from es6 if not already supported. See config for Babel and Webpack4 as follows

npm i --save-dev @babel/cli @babel/core @babel/node @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-proposal-optional-chaining @babel/plugin-syntax-bigint @babel/register AND npm i babel-loader

babel.config.js

module.exports = (api) => {
  api.cache(true)
  const plugins = [
    '@babel/plugin-proposal-optional-chaining',
    '@babel/plugin-proposal-nullish-coalescing-operator',
    '@babel/plugin-syntax-bigint'
  ]
  return { plugins }
}

webpack.config.js

config.module.rules = [
  ...otherModuleRules,
  {
    test: /\.js$/,
    exclude: (_) => !/node_modules\/(@web3auth|@ethereumjs)/.test(_),
    loader: 'babel-loader'
  }
]