persistent-user-id
v1.5.0
Published
a library for generating a random userid and saving it in local storage so the id stays consistent on page reloads
Downloads
5
Readme
presisent-user-Id
This package provides a simple utility for generating and managing a user ID that can be stored in the browser’s localStorage. It ensures that each user is assigned a unique identifier, which is persistent across sessions and retrievable whenever needed.
example import userId from "persistent-user-id" const userId = getUserId(); console.log(userId); // Either returns an existing ID or generates a new one.
credits peerfect