From d1ad5ac373ff2ff66450afc74aeba9b26fc133ce Mon Sep 17 00:00:00 2001 From: Dimitris Klouvas Date: Fri, 29 Sep 2023 17:46:20 +0300 Subject: [PATCH] chore(clerk-js): Warn about Clerk.setSession deprecation (#1800) --- .changeset/tender-cameras-yawn.md | 7 +++++++ packages/clerk-js/src/core/clerk.ts | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/tender-cameras-yawn.md diff --git a/.changeset/tender-cameras-yawn.md b/.changeset/tender-cameras-yawn.md new file mode 100644 index 00000000000..9b1de659377 --- /dev/null +++ b/.changeset/tender-cameras-yawn.md @@ -0,0 +1,7 @@ +--- +'@clerk/clerk-js': patch +--- + +Apply deprecation warnings for `@clerk/clerk-js`: + +- `Clerk.setSession` diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index dc63bebdb43..79cc54dd11f 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -631,10 +631,14 @@ export default class Clerk implements ClerkInterface { this.#resetComponentsState(); }; + /** + * @deprecated Use `setActive` instead. + */ public setSession = async ( session: ActiveSessionResource | string | null, beforeEmit?: BeforeEmitCallback, ): Promise => { + deprecated('setSession', 'Use `setActive` instead.', 'clerk:setSession'); return this.setActive({ session, beforeEmit }); };