User.getAnonymousKey
Functional API
getAnonymousKeyYou can use the same function with this as well.
Feature description
Fetch the user's unique key from the mini app. You can use this key to identify the user and manage data. If successful, { type: 'HASH', hash } returns a value in the form of.
Toss app 5.232.0 It can be used on the above.
Type
User.getAnonymousKey(): Promise<GetAnonymousKeyResponse>;Params
None
Response
type GetAnonymousKeyResponse = {
hash: string;
type: "HASH";
};Example code
import { User } from "@apps-in-toss/web-framework";
async function handleGetAnonymousKey() {
try {
const result = await User.getAnonymousKey();
console.log("User key:", result.hash);
} catch (error) {
console.error(error);
}
}Was this helpful?