@web5nexus/sociallogin
TypeScript icon, indicating that this package has built-in type declarations

1.1.75 • Public • Published

@web5nexus/sociallogin

A library to import the torus web3 social auth directly from Web5 Nexus SDK

Sample Project for Web5 Nexus Social Auth Social Auth Example

Usage

import SocialLogin,{EvmRpc} from "@web5nexus/sociallogin";
// Pre-Requiste
// Get from https://dashboard.web3auth.io for Saphire Mainnet only
const clientId = "Client ID recieved from Web3Auth Dashboard";
const clientSecret = "Client Secret Recieved from Web3Auth Dashboard";

// Addional Customization
const name = "XDC Auth"
const logo = "https://xinfin.org/assets/images/brand-assets/xdc-icon.png"
const network :NetworkOption = "sapphire_mainnet";

const whiteLabel = {
    name :name,
    logo :logo
}
const params: Web3AuthParamsType={
    type: "web3auth",
    clientId:clientId,
    clientSecret:clientSecret
}

// init wallet
const socialLoginSDK = new SocialLogin(params,whiteLabel);
await socialLoginSDK.init(network);
// show connect modal
socialLoginSDK.showWallet();


// For Blockchain Instance 
const blockchain:BlockchainType ={
    blockchain:"xinfin",
    network:"mainnet"
}

// Optional own RPC URL 
var rpcUrl = "https://erpc.xdcrpc.com";
const xdcInstance = new EvmRpc(socialLoginSDK.provider,blockchain,rpcUrl)

Package Sidebar

Install

npm i @web5nexus/sociallogin

Weekly Downloads

3

Version

1.1.75

License

MIT

Unpacked Size

235 kB

Total Files

22

Last publish

Collaborators

  • jetsoanalin
  • web5team