Skip to content

Conversation

@gyaneshgouraw-okta
Copy link
Contributor

Summary

Adds a getConfiguration() method to the auth0-react SDK that exposes the Auth0 domain and clientId configuration values. This method delegates to the underlying Auth0Client.getConfiguration() from @auth0/auth0-spa-js.

Developers need programmatic access to the SDK configuration they provided during initialization. Without this, developers must manually track domain and clientId values separately, leading to:

  • Duplication of configuration values
  • Potential inconsistencies
  • Extra boilerplate for building custom Auth0-related URLs

Changes

New Feature

  • getConfiguration() - Returns a readonly object containing { domain, clientId } from the SDK initialization

Usage

With useAuth0 hook

import { useAuth0 } from '@auth0/auth0-react';

const MyComponent = () => {
  const { getConfiguration } = useAuth0();
  const config = getConfiguration();

  console.log(config.domain);   // 'tenant.auth0.com'
  console.log(config.clientId); // 'abc123'
};

With withAuth0 HOC

import { withAuth0, WithAuth0Props } from '@auth0/auth0-react';

class MyComponent extends Component<WithAuth0Props> {
  render() {
    const config = this.props.auth0.getConfiguration();
    return <div>Domain: {config.domain}</div>;
  }
}

export default withAuth0(MyComponent);

Test Plan

  • Existing tests pass (102 tests)
  • 100% code coverage maintained
  • New relevant tests added:
  • Lint passes
  • Build succeeds

Breaking Changes

None. This is a purely additive change.

@gyaneshgouraw-okta gyaneshgouraw-okta marked this pull request as ready for review January 27, 2026 08:56
@gyaneshgouraw-okta gyaneshgouraw-okta requested a review from a team as a code owner January 27, 2026 08:56
@gyaneshgouraw-okta gyaneshgouraw-okta merged commit c25cb38 into main Jan 27, 2026
12 of 13 checks passed
@gyaneshgouraw-okta gyaneshgouraw-okta deleted the feat/domain-clientid-integration branch January 27, 2026 09:12
gyaneshgouraw-okta added a commit that referenced this pull request Jan 28, 2026
**Added**
- feat: add getConfiguration method to Auth0Client and updated
documentation [\#991](#991)
([gyaneshgouraw-okta](https://github.com/gyaneshgouraw-okta))
- Security: Example app update Next.js dependency for CVE-2025-55184 and
CVE-2025-55183 [\#951](#951)
([tusharpandey13](https://github.com/tusharpandey13))
gyaneshgouraw-okta added a commit that referenced this pull request Jan 28, 2026
**Added**
- feat: add getConfiguration method to Auth0Client and updated
documentation [\#991](#991)
([gyaneshgouraw-okta](https://github.com/gyaneshgouraw-okta))

**Security**
- Security: Example app update Next.js dependency for CVE-2025-55184 and
CVE-2025-55183 [\#951](#951)
([tusharpandey13](https://github.com/tusharpandey13))
gyaneshgouraw-okta added a commit that referenced this pull request Jan 28, 2026
**Added**
- feat: add getConfiguration method to Auth0Client and updated
documentation [\#991](#991)
([gyaneshgouraw-okta](https://github.com/gyaneshgouraw-okta))
- Security: Example app update Next.js dependency for CVE-2025-55184 and
CVE-2025-55183 [\#951](#951)
([tusharpandey13](https://github.com/tusharpandey13))
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.

2 participants