chore: expose getAccessToken & exchangeToken from useAsgardeo#135
Merged
brionmario merged 4 commits intoasgardeo:mainfrom Sep 4, 2025
Merged
chore: expose getAccessToken & exchangeToken from useAsgardeo#135brionmario merged 4 commits intoasgardeo:mainfrom
getAccessToken & exchangeToken from useAsgardeo#135brionmario merged 4 commits intoasgardeo:mainfrom
Conversation
AmshikaH
approved these changes
Sep 4, 2025
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.
Purpose
This pull request introduces support for token exchange functionality across the JavaScript, React, and Next.js SDKs for Asgardeo. The main changes include adding a new
exchangeTokenmethod to the core client interfaces and implementations, updating context types and providers to expose this method, and ensuring proper type imports and usage throughout the codebase.Token Exchange Feature Integration
exchangeTokenmethod to theAsgardeoClientinterface and its abstract implementation inAsgardeoJavaScriptClient, enabling token swapping based on a provided configuration. [1] [2]exchangeTokenmethod in bothAsgardeoReactClientandAsgardeoNextClient, delegating to the underlying Asgardeo client and handling session IDs as needed. [1] [2]Context and Provider Updates (React SDK)
AsgardeoContextPropstype and the default context value to include the newexchangeTokenmethod, making it available to React consumers. [1] [2]exchangeTokenmethod to the context provider, ensuring it is correctly exposed to all components using the context.Type and Import Adjustments
TokenExchangeRequestConfigwherever token exchange functionality is used, ensuring type safety and consistency in all relevant files. [1] [2] [3] [4] [5] [6]Next.js Server Integration
exchangeTokenutility to the Next.js server-sideasgardeo.tshelper, allowing server-side code to perform token exchanges using the SDK.These changes collectively enable secure and flexible token exchange operations for applications using the Asgardeo SDKs.
Related Issues
@asgardeo/react&@asgardeo/nextjs#81Related PRs
Checklist
Security checks