Skip to content

vitacore-company/vita3auth

Repository files navigation

Vita3auth

React component based on ethers.js library for easy authorization in web3 applications. Login requires mail, password and a unique guid for more security. Save the generated guid for your next login. After creating the wallet, the component gives the Wallet object.

Installation

npm install @vitacore-company/vita3auth --save

Usage

import { Auth } from "@vitacore-company/vita3auth"
import "@vitacore-company/vita3auth/dist/index.css"

<Auth
  onEOAchange={setEOAwallet}
  label="Authorization"
  language="en"
  saveCodeExternal={[
    {
      label: "Console code",
      fn: (code) => console.log(code),
      icon: () => <div>Console</div>,
    },
  ]}
  addCodeExternal={[
    {
      label: "Add code external",
      fn: () => "cf0a4220-50c1-4539-89b4-9155195b5e9e",
      icon: () => <div>External</div>,
    },
  ]}
  providerURL="https://rpc.chiadochain.net"
/>

Acknowledgements

Styles

add @vitacore-company/vita3auth/dist/index.[css/scss]

API

Auth

Parameter Type Description
onEOAchange (wallet: Wallet) => void Required Returns wallet object after generating
label string Required Title of the login page
saveCodeExternal obj Required ISaveExternalMethod[]
addCodeExternal obj Required IAddExternalMethod[]
providerURL? string Blockchain provider
language? string en,ru,ch,ar,sp,in,it,ge

Types

interface IAddExternalMethod {
  label: string
  fn: () => string
  icon: () => JSX.Element
}
interface ISaveExternalMethod {
  label: string
  fn: (e: string) => void
  icon: () => JSX.Element
}

Predefined localization

sp Spainish, ge Deutsch, ru Russian
en English, ch Chinese, it Italian
in Indian, ar Arabic

AddressEOA

import { AddressEOA } from "@vitacore-company/vita3auth"
import "@vitacore-company/vita3auth/dist/index.css"


<AddressEOA address={EOAwallet.address} />
Parameter Type Description
address? string
noAddressLabel? string

Authors

🔗 Links

github

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages