Sign-Out
The signOut
method is used to log out the authenticated user from zkDatabase.
Definition
await zkdb.auth.signOut(): Promise<void>;
Parameters
- None
Returns
Promise<void>
: Completes when the user session is successfully terminated. This clears the stored access token and user information from local storage, requiring the user to authenticate again for future API calls.
Example
import { ZkDatabase } from 'zkdb';
const zkdb = await ZkDatabase.connect({
userName: "chiro-user",
privateKey: "EKFTciRxyxshZjimay9sktsn7v5PvmC5zPq7q4JnitHUytxUVnFP",
environment: "node",
// This URL is for test environment
url: "https://api.zkdatabase.org/graphql",
});
await zkdb.auth.signOut();
This example demonstrates how to sign out the currently authenticated user from zkDatabase.