docs: update Internet Identity guide for new AuthClient API#189
Closed
sea-snake wants to merge 5 commits intodfinity:mainfrom
Closed
docs: update Internet Identity guide for new AuthClient API#189sea-snake wants to merge 5 commits intodfinity:mainfrom
sea-snake wants to merge 5 commits intodfinity:mainfrom
Conversation
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.
This was referenced May 4, 2026
This was referenced May 4, 2026
Member
|
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
@icp-sdk/authlibrary was updated. This bringsdocs/guides/authentication/internet-identity.mdxin line with the new API:AuthClient.create()(static factory) becomesnew AuthClient(options).identityProvider,derivationOrigin, andopenIdProvidermove onto the constructor (no longer per-call).login({ onSuccess, onError })becomes promise-basedawait signIn({ maxTimeToLive }), returning theIdentitydirectly.isAuthenticated()is now sync;getIdentity()is now async.openIdProvider: 'google' | 'apple' | 'microsoft').derivationOriginis set on the constructor.onSuccess/onErrorcallbacks is replaced with one about not awaitingsignIn()or skipping thetry/catch.npm run buildpasses locally.Note: the upstream
internet-identityskill indfinity/icskills(referenced from this page's<!-- Upstream: -->trailer) is also out of date for the same reason. A separate PR has been opened againstdfinity/icskillsto update it.Sync recommendation
informed by dfinity/icp-js-auth — README.md and src/client/auth-client.ts (v6 API surface)