Integrate via
- script tag
- npm
- yarn
<script src="https://cdn.jsdelivr.net/npm/@toruslabs/customauth@6"></script>
The script tag creates a window.directWebSdk
object, which you can initialize.
npm i --save @toruslabs/customauth
yarn add @toruslabs/customauth
Examples
- Basic
import DirectWebSdk from "@toruslabs/customauth";
const torus = new DirectWebSdk({
baseUrl: "http://localhost:3000/serviceworker/",
network: "testnet", // details for test net
});
await torus.init();
const loginDetails = await torus.triggerLogin({
typeOfLogin: "google",
verifier: "YOUR VERIFER DEPLOYED BY TORUS",
clientId: "MY CLIENT ID GOOGLE",
});