@icp-sdk/auth
v11.3.0
Published
Authentication library for Internet Computer web apps
Readme
@icp-sdk/auth
Authentication library for Internet Computer web apps.
Still using
@dfinity/auth-client? Migrate to@icp-sdk/auth!
Installation
npm install @icp-sdk/auth @icp-sdk/coreThis package is only meant to be used in browser environments.
Usage
import { AuthClient } from '@icp-sdk/auth/client';
const authClient = new AuthClient();
await authClient.signIn();
const identity = await authClient.getIdentity();
console.log('Signed in as', identity.getPrincipal().toText());
await authClient.signOut();Documentation
- Guides: project setup, identity attributes, one-click sign-in, enterprise SSO, and shared sessions across subdomains.
- API reference and upgrade guides.
Contributing
Contributions are welcome! Please see the contribution guide for more information.
License
This project is licensed under the Apache-2.0 license.
