Skip to content

Conversation

brionmario
Copy link
Member

@brionmario brionmario commented Sep 29, 2025

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:

  • Added the reInitialize abstract method to the core AsgardeoJavaScriptClient class and the AsgardeoClient interface, allowing clients to be re-initialized with partial configuration updates. [1] [2]

Next.js SDK Updates:

  • Implemented the reInitialize method in AsgardeoNextClient, including error handling and return value, and exposed it via the server utility in asgardeo.ts. [1] [2] [3]

React SDK Updates:

  • Implemented the reInitialize method in AsgardeoReactClient with loading state management and error handling.
  • Added reInitialize to the AsgardeoContextProps type and provided it in the default context and through the AsgardeoProvider, making it available to React consumers. [1] [2] [3]

Related Issues

Related PRs

  • N/A

Checklist

  • e2e cypress tests locally verified.
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

@brionmario brionmario merged commit 181b0dc into asgardeo:main Sep 29, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: option to re-initialize the SDK on the fly is not exposed

2 participants