dfinity / agent-js

A collection of libraries and tools for building software around the Internet Computer, in JavaScript.
https://agent-js.icp.xyz
Apache License 2.0
155 stars 96 forks source link

feat: use-auth-client react hook #911

Closed krpeacock closed 3 months ago

krpeacock commented 3 months ago

Description

Introduces a new library: @dfinity/use-auth-client

Simplifies managing authentication using best practices with hooks and effects.

Logout and onIdle also ends session for Actors managed by the auth hook.

Example app live at https://5ibdo-haaaa-aaaab-qajia-cai.icp0.io/

How Has This Been Tested?

New unit test and an example project. More testing would probably be worthwhile

Checklist:

github-actions[bot] commented 3 months ago

size-limit report 📦

Path Size
@dfinity/agent 85.63 KB (0%)
@dfinity/candid 13.58 KB (0%)
@dfinity/principal 4.97 KB (0%)
@dfinity/auth-client 60.3 KB (0%)
@dfinity/assets 80.8 KB (0%)
@dfinity/identity 57.51 KB (0%)
@dfinity/identity-secp256k1 130.6 KB (0%)