Skip to main content

Integrate via#

<script src="https://cdn.jsdelivr.net/npm/@toruslabs/torus-direct-web-sdk@4"></script>

The script tag creates a window.directWebSdk object, which you can initialize.

Examples#

import DirectWebSdk from "@toruslabs/torus-direct-web-sdk";
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",
});