Skip to content

Commit

Permalink
chore(clerk-js): Warn about Clerk.setSession deprecation (#1800)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkl authored Sep 29, 2023
1 parent a0b2567 commit d1ad5ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/tender-cameras-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@clerk/clerk-js': patch
---

Apply deprecation warnings for `@clerk/clerk-js`:

- `Clerk.setSession`
4 changes: 4 additions & 0 deletions packages/clerk-js/src/core/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
deprecated('setSession', 'Use `setActive` instead.', 'clerk:setSession');
return this.setActive({ session, beforeEmit });
};

Expand Down

0 comments on commit d1ad5ac

Please sign in to comment.