Skip to content

Update useKindeAuth to new implementation with deprecation warning#439

Merged
Koosha-Owji merged 2 commits intokinde-oss:mainfrom
dtoxvanilla1991:fix/useKindeAuth-pointer
Mar 13, 2026
Merged

Update useKindeAuth to new implementation with deprecation warning#439
Koosha-Owji merged 2 commits intokinde-oss:mainfrom
dtoxvanilla1991:fix/useKindeAuth-pointer

Conversation

@dtoxvanilla1991
Copy link
Copy Markdown
Contributor

@dtoxvanilla1991 dtoxvanilla1991 commented Feb 14, 2026

Explain your changes

Update the useKindeAuth function to point to the new useKindeBrowserClient implementation and add a deprecation warning. This change prepares for the eventual removal of useKindeAuth in a future major version.

Breaking changes
None. useKindeAuth() returns the same KindeState type as before - it just works now.

Checklist

🛟 If you need help, consider asking for advice over in the Kinde community.

@dtoxvanilla1991 dtoxvanilla1991 requested a review from a team as a code owner February 14, 2026 23:31
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 14, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Adds an exported flagDataTypeMap mapping s -> "string", i -> "integer", b -> "boolean", j -> "json" to the feature-flag factory; introduces a deprecated useKindeAuth wrapper that warns once and forwards to useKindeBrowserClient; updates src/frontend/index.js to export from the new wrapper.

Changes

Cohort / File(s) Summary
Deprecation wrapper & index export
src/frontend/useKindeAuth.ts, src/frontend/index.js
Adds useKindeAuth as a deprecated wrapper around useKindeBrowserClient that emits a one-time console warning; updates src/frontend/index.js to export useKindeAuth from the new module (removes previous OldAuthProvider.jsx export).
Feature flag type map
src/frontend/factories/feature-flag-factory.ts
Exports new flagDataTypeMap: Record<KindeFlagTypeCode, KindeFlagTypeValue> with mappings s: "string", i: "integer", b: "boolean", j: "json" and imports KindeFlagTypeValue for typing; getFlagFactory uses the local map for type resolution and errors.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating useKindeAuth to use a new implementation with a deprecation warning.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation for updating useKindeAuth and confirming no breaking changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/frontend/factories/feature-flag-factory.ts`:
- Around line 5-10: The flagDataTypeMap constant is missing the "j" key required
by the KindeFlagTypeCode union; update flagDataTypeMap to include j: "json" so
it satisfies Record<KindeFlagTypeCode, KindeFlagTypeValue> (i.e., add the "j"
entry to the exported flagDataTypeMap object to match the
KindeFlagTypeCode/"b"|"i"|"s"|"j" and KindeFlagTypeValue types).

@dtoxvanilla1991 dtoxvanilla1991 self-assigned this Feb 14, 2026
@dtoxvanilla1991 dtoxvanilla1991 force-pushed the fix/useKindeAuth-pointer branch from 9e5cc7d to 17a9bbd Compare February 14, 2026 23:45
@dtoxvanilla1991 dtoxvanilla1991 linked an issue Feb 14, 2026 that may be closed by this pull request
4 tasks
@DanielRivers
Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 16, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Koosha-Owji Koosha-Owji merged commit c7018ea into kinde-oss:main Mar 13, 2026
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.

Bug: useKindeAuth() broken with React 19.1.0 (Next.js 15 Pages Router)

3 participants