assistant-conversation-nodejs
assistant-conversation-nodejs copied to clipboard
User ID
I don't see any ID property on the User class but is there a way to retrieve this somewhere, or is there an equivalent/proxy for this?
@shotamakino You can make your own -
import { ConversationV3 } from "@assistant/conversation";
import { v4 as uuidv4 } from "uuid";
export const userId = (conv: ConversationV3): string => {
if (!conv.user.params.userId) {
const newUserId = uuidv4();
conv.user.params.userId = newUserId;
}
return conv.user.params.userId as string;
};
kkocel is correct there is no inherent user identifier but you can generate one and place it in user storage.