A Chip is similar to an entry - or a user - in a database. It has a series of information, includingid
, companyId
, publicData
, privateData
and name
. It is stored in a ChipCollection
inside the users’ storage within the Flow Blockchain.
This guide will outline the code behind a sample website that uses the BuzzLib library to authenticate a user.
When the user first enters our sample website, they are taken to this landing page:
There are different ways to make sure the user is always authorized, but we chose to use state management. Therefore, as soon as the user begins to load our website the following code runs:
const [user, setUser] = useState(null);
const [transactionStatus, setTransactionStatus] = useState(null); // NEW
The line after that, we ensure the user is initialized:
BuzzLib.initialize(setTransactionStatus, user, setUser);
The initialize function sets up the environment for the user and authenticates a logged in user.