Sign in Applications in Near
Sign In
// Sender will show a popup dialog to ask user to authorize your dApp
// This creates an access key that will be stored in Sender's storage
// The access key can then be used to connect to NEAR and sign transactions
await window.near.requestSignIn({
contractId: "guest-book.testnet", // contract requesting access
});
// Or add `methodNames` if you only allow the key to call some of the methods
await window.near.requestSignIn({
contractId: "guest-book.testnet", // contract requesting access
methodNames: ["addMessage"] // (optional) changed methods the app allowed to use
});
window.near.isSignedIn() // trueSign Out
Last updated