The ic-use-internet-identity React hook has been updated to include reactive updates when a user’s current Internet Identity expires, improving the experience for developers and end users on the Internet Computer. While the change may appear modest, it addresses a practical issue that often disrupts user interactions.
Internet Identity is an authentication service on the Internet Computer that allows users to create a secure identity for interacting with canisters, the platform’s smart contracts. The React hook simplifies integration into applications, providing an intuitive interface for logging in and out while maintaining compatibility with other tools like ic-use-actor, which facilitates access to canister methods.
Key features of the hook include cached identity, which stores credentials in local storage to keep users logged in even after page reloads, and login progress indicators, allowing applications to track whether a user is logged in, logging in, or logged out. The recent update introduces reactive identity expiry, meaning that when an identity becomes invalid, the authentication state resets automatically and the user interface updates in real time. This avoids the need for manual refreshes or additional checks and ensures applications remain in sync with the user’s session status.
The hook also supports router integration, exposing functions like ensureInitialized() and isAuthenticated() for use outside of React components, as demonstrated in examples using TanStack Router. Developers can see the functionality in action through a demo where identities expire after ten seconds, offering a hands-on view of the new reactive behaviour.
Although the update is relatively small, it contributes to smoother user experiences on the Internet Computer and demonstrates ongoing efforts to refine developer tools. By ensuring that applications respond accurately to identity changes, ic-use-internet-identity helps maintain security, reduce friction, and provide a more reliable interface for interacting with the growing ecosystem of ICP canisters.
Demo link: https://5pfgi-wiaaa-aaaan-qz7bq-cai.icp0.io
Dear Reader,
Ledger Life is an independent platform dedicated to covering the Internet Computer (ICP) ecosystem and beyond. We focus on real stories, builder updates, project launches, and the quiet innovations that often get missed.
We’re not backed by sponsors. We rely on readers like you.
If you find value in what we publish—whether it’s deep dives into dApps, explainers on decentralised tech, or just keeping track of what’s moving in Web3—please consider making a donation. It helps us cover costs, stay consistent, and remain truly independent.
Your support goes a long way.
🧠 ICP Principal: ins6i-d53ug-zxmgh-qvum3-r3pvl-ufcvu-bdyon-ovzdy-d26k3-lgq2v-3qe
🧾 ICP Address: f8deb966878f8b83204b251d5d799e0345ea72b8e62e8cf9da8d8830e1b3b05f
🪙 BTC Wallet: bc1pp5kuez9r2atdmrp4jmu6fxersny4uhnaxyrxau4dg7365je8sy2q9zff6p
Every contribution helps keep the lights on, the stories flowing, and the crypto clutter out.
Thank you for reading, sharing, and being part of this experiment in decentralised media.
—Team Ledger Life




