Skip to content

docs: update Internet Identity guide for new AuthClient API#189

Closed
sea-snake wants to merge 5 commits intodfinity:mainfrom
sea-snake:docs/auth-client-v6-update
Closed

docs: update Internet Identity guide for new AuthClient API#189
sea-snake wants to merge 5 commits intodfinity:mainfrom
sea-snake:docs/auth-client-v6-update

Conversation

@sea-snake
Copy link
Copy Markdown

Summary

The @icp-sdk/auth library was updated. This brings docs/guides/authentication/internet-identity.mdx in line with the new API:

  • AuthClient.create() (static factory) becomes new AuthClient(options).
  • identityProvider, derivationOrigin, and openIdProvider move onto the constructor (no longer per-call).
  • login({ onSuccess, onError }) becomes promise-based await signIn({ maxTimeToLive }), returning the Identity directly.
  • isAuthenticated() is now sync; getIdentity() is now async.
  • Adds a one-click OpenID example (openIdProvider: 'google' | 'apple' | 'microsoft').
  • Updates the alternative-origins example so derivationOrigin is set on the constructor.
  • Common-mistakes bullet about missing onSuccess/onError callbacks is replaced with one about not awaiting signIn() or skipping the try/catch.

npm run build passes locally.

Note: the upstream internet-identity skill in dfinity/icskills (referenced from this page's <!-- Upstream: --> trailer) is also out of date for the same reason. A separate PR has been opened against dfinity/icskills to update it.

Sync recommendation

informed by dfinity/icp-js-auth — README.md and src/client/auth-client.ts (v6 API surface)

The @icp-sdk/auth library was updated: AuthClient is now constructed
directly (not via a static factory), sign-in is promise-based, and
isAuthenticated() and getIdentity() flipped sync/async. Also moves
identityProvider, derivationOrigin, and openIdProvider onto the
constructor, and adds a one-click OpenID example.
@marc0olo
Copy link
Copy Markdown
Member

marc0olo commented May 4, 2026

Superseded by #193 — your branch was rebased onto main, the two required submodule bumps were added (icp-js-sdk-docs → auth v7.0.0, cdk-rs → ic-cdk v0.20.1), and a broken link was fixed. All your commits are preserved in the new PR's history. Thank you for the contribution!

@marc0olo marc0olo closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants