Skip to content

Commit

Permalink
chore(backend): Warn about __unstable_options deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkl committed Sep 28, 2023
1 parent 0193085 commit bdfbf0d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { deprecatedObjectProperty } from '@clerk/shared';

import type { CreateBackendApiOptions } from './api';
import { createBackendApiClient } from './api';
import type { CreateAuthenticateRequestOptions } from './tokens';
Expand Down Expand Up @@ -26,12 +28,22 @@ export function Clerk(options: ClerkOptions) {
const apiClient = createBackendApiClient(opts);
const requestState = createAuthenticateRequest({ options: opts, apiClient });

return {
const clerkInstance = {
...apiClient,
...requestState,
/**
* @deprecated This prop has been deprecated and will be removed in the next major release.
*/
__unstable_options: opts,
};

// The __unstable_options is not being used internally and
// it's only being set in packages/sdk-node/src/clerkClient.ts#L86
deprecatedObjectProperty(
clerkInstance,
'__unstable_options',
'Use `createClerkClient({...})` to create a new clerk instance instead.',
);

return clerkInstance;
}

0 comments on commit bdfbf0d

Please sign in to comment.