Othent
  • 👋Welcome to Othent
  • 🥪JS SDK
    • Getting Started
    • Events
    • Error Handling
    • Binary Data Types Utils
    • TypeScript Types
    • Config Constants
  • 🥪JS SDK API
    • constructor()
    • startTabSynching()
    • completeConnectionAfterRedirect()
    • connect()
    • disconnect()
    • requireAuth()
    • isAuthenticated
    • getActiveAddress()
    • getActivePublicKey()
    • getAllAddresses()
    • getWalletNames()
    • getUserDetails()
    • getSyncActiveAddress()
    • getSyncActivePublicKey()
    • getSyncAllAddresses()
    • getSyncWalletNames()
    • getSyncUserDetails()
    • sign() (transaction)
    • dispatch() (transaction)
    • encrypt()
    • decrypt()
    • signature()
    • signDataItem()
    • signMessage()
    • verifyMessage()
    • privateHash()
    • walletName
    • walletVersion
    • config
    • getArweaveConfig()
    • getPermissions()
  • Demos
    • 🍏SDK playground / demo
    • 🍏SDK playground / demo GitHub
    • 🍎File upload app example
    • 🍎File upload app example GitHub
  • 📚External libraries
    • arweave-js
    • Arweave Wallet Kit
  • Additional Links
    • 🌐Othent.io
    • 🌐Discord
    • 🌐GitHub
    • 🌐X
Powered by GitBook
On this page
  • API
  • Example usage
  1. JS SDK API

isAuthenticated

Othent JS SDK isAuthenticated property

Indicates whether the user is currently authenticated.

API

isAuthenticated: boolean;

Example usage

import { Othent } from "@othent/kms";

const othent = new Othent({ appInfo, throwErrors: false, ... });

// ...

const storeSecret = async (key: string, plaintext: string) => {
    // Manually make sure the user is authenticated, or prompt them to authenticate:
    if (!othent.isAuthenticated) {
        await othent.connect();
    }

    // Now we can call other functions from Othent:
    const encryptedData = await othent.encrypt(plaintext);

    localStorage.set(key, encryptedData);
}
PreviousrequireAuth()NextgetActiveAddress()

Last updated 8 months ago

🥪