supertokens-node
    Preparing search index...

    Type Alias RecipeInterface

    type RecipeInterface = {
        clearUserMetadata: (
            input: { userContext: UserContext; userId: string },
        ) => Promise<{ status: "OK" }>;
        getUserMetadata: (
            input: { userContext: UserContext; userId: string },
        ) => Promise<{ metadata: any; status: "OK" }>;
        updateUserMetadata: (
            input: {
                metadataUpdate: JSONObject;
                userContext: UserContext;
                userId: string;
            },
        ) => Promise<{ metadata: JSONObject; status: "OK" }>;
    }
    Index

    Properties

    clearUserMetadata: (
        input: { userContext: UserContext; userId: string },
    ) => Promise<{ status: "OK" }>
    getUserMetadata: (
        input: { userContext: UserContext; userId: string },
    ) => Promise<{ metadata: any; status: "OK" }>
    updateUserMetadata: (
        input: {
            metadataUpdate: JSONObject;
            userContext: UserContext;
            userId: string;
        },
    ) => Promise<{ metadata: JSONObject; status: "OK" }>

    Updates the metadata object of the user by doing a shallow merge of the stored and the update JSONs and removing properties set to null on the root level of the update object. e.g.:

    • stored: { "preferences": { "theme":"dark" }, "notifications": { "email": true }, "todos": ["example"] }
    • update: { "notifications": { "sms": true }, "todos": null }
    • result: { "preferences": { "theme":"dark" }, "notifications": { "sms": true } }