fix: expose reInitialize
from @asgardeo/react
& @asgardeo/nextjs
#181
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.
Purpose
This pull request introduces a new method,
reInitialize
, across the Asgardeo JavaScript SDK clients (core, React, and Next.js) to allow dynamic re-initialization of the client with a partial configuration. This enables updating configuration fields without a full re-initialization, improving flexibility for applications that need to update authentication settings at runtime. The method is added to the core client interface, implemented in the React and Next.js clients, and exposed through the relevant context/provider layers.Core SDK Enhancements:
reInitialize
abstract method to the coreAsgardeoJavaScriptClient
class and theAsgardeoClient
interface, allowing clients to be re-initialized with partial configuration updates. [1] [2]Next.js SDK Updates:
reInitialize
method inAsgardeoNextClient
, including error handling and return value, and exposed it via the server utility inasgardeo.ts
. [1] [2] [3]React SDK Updates:
reInitialize
method inAsgardeoReactClient
with loading state management and error handling.reInitialize
to theAsgardeoContextProps
type and provided it in the default context and through theAsgardeoProvider
, making it available to React consumers. [1] [2] [3]Related Issues
Related PRs
Checklist
Security checks