-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(clerk-js): Send FAPI version through URLSearchParams #4457
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 93fe983 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -91,6 +92,9 @@ export function createFapiClient(clerkInstance: Clerk): FapiClient { | |||
const searchParams = new URLSearchParams(search as any); | |||
// the above will parse {key: ['val1','val2']} as key: 'val1,val2' and we need to recreate the array bellow | |||
|
|||
// Append supported FAPI version to the query string | |||
searchParams.append('__clerk_api_version', SUPPORTED_FAPI_VERSION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one for clerk js version only has one underscore as a prefix, is there a reason we break out of the existing pattern ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question. Following the docs here: https://clerk.com/docs/backend-requests/versioning/overview#choosing-an-api-version . I can confirm with the API team that the double underscore is expected
@@ -37,3 +37,6 @@ export const SIGN_UP_MODES: Record<string, SignUpModes> = { | |||
PUBLIC: 'public', | |||
RESTRICTED: 'restricted', | |||
}; | |||
|
|||
// This is the currently support version of the Frontend API | |||
export const SUPPORTED_FAPI_VERSION = '2024-10-01'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about FAPI versioning and keeping types in sync. The types package version and which FAPI version they represent.
Description
We need to pass the FAPI version as a query param
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change