Skip to content

Add enum helpers to improve UX#8233

Open
EnchantedNight wants to merge 2 commits intoclerk:mainfrom
EnchantedNight:enum-helpers
Open

Add enum helpers to improve UX#8233
EnchantedNight wants to merge 2 commits intoclerk:mainfrom
EnchantedNight:enum-helpers

Conversation

@EnchantedNight
Copy link
Copy Markdown

@EnchantedNight EnchantedNight commented Apr 3, 2026

Description

Summary

Add type-safe enum objects to @clerk/shared for OAuth providers and strategies, eliminating magic strings in user code.

Changes

  • Add OAuthProviderEnum - camelCased keys mapping to provider names
  • Add OAuthStrategyEnum - camelCased keys mapping to Clerk's oauth_${provider} strategy format
  • Export both from @clerk/shared/types

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 3, 2026

⚠️ No Changeset found

Latest commit: 97ea825

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

@EnchantedNight is attempting to deploy a commit to the Clerk Production Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a new packages/shared/src/types/enums.ts module that exports two as const enum-like objects for OAuth configuration: OAuthProviderEnum (mapping provider names to identifiers like 'linkedin_oidc', 'x') and OAuthStrategyEnum (mapping the same keys to Clerk-style strategy strings like 'oauth_google', 'oauth_linkedin_oidc'). Corresponding TypeScript union types are exported, derived from these enums and validated against existing OAuthProvider and OAuthStrategy types. The central types index file is updated to re-export all exports from the new enums module.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add enum helpers to improve UX' directly corresponds to the main change: introducing OAuthProviderEnum and OAuthStrategyEnum to replace magic strings with type-safe enum objects.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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


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.

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.

1 participant