Authentication library for Internet Computer web apps.
Still using
@dfinity/auth-client? Migrate to@icp-sdk/auth!
npm install @icp-sdk/auth @icp-sdk/coreThis package is only meant to be used in browser environments.
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();- Guides: project setup, identity attributes, one-click sign-in, enterprise SSO, and shared sessions across subdomains.
- API reference and upgrade guides.
Contributions are welcome! Please see the contribution guide for more information.
This project is licensed under the Apache-2.0 license.