Skip to content

feat(web-js-sdk): export last user helper functions#1332

Open
meirarmon wants to merge 1 commit intodescope:mainfrom
meirarmon:feat/export-last-user-helpers
Open

feat(web-js-sdk): export last user helper functions#1332
meirarmon wants to merge 1 commit intodescope:mainfrom
meirarmon:feat/export-last-user-helpers

Conversation

@meirarmon
Copy link

Summary

Export the last authenticated user helper functions from the public API:

  • setLastUserLoginId(loginId: string)
  • setLastUserDisplayName(displayName: string)
  • removeLastUserLoginId()
  • removeLastUserDisplayName()

The getter functions (getLastUserLoginId, getLastUserDisplayName) are also exported for completeness, though they were already accessible on the SDK instance.

Motivation

Fixes #1331

These functions already exist in enhancers/withLastLoggedInUser/helpers.ts but are not exported from the package. This makes it impossible for consumers to programmatically set or clear the last authenticated user without directly accessing the internal localStorage keys.

Changes

  • Added exports to packages/sdks/web-js-sdk/src/index.ts
  • Added UMD export tests to packages/sdks/web-js-sdk/test/umd.test.ts

Export setLastUserLoginId, setLastUserDisplayName, removeLastUserLoginId,
and removeLastUserDisplayName from the public API.

These functions already exist internally but are not exported, making it
impossible for consumers to programmatically set or clear the last
authenticated user without directly accessing localStorage keys.
@vercel
Copy link

vercel bot commented Feb 12, 2026

@meirarmon is attempting to deploy a commit to the descope Team on Vercel.

A member of the Team first needs to authorize it.

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.

Export last user helper functions (setLastUserLoginId, removeLastUserLoginId, etc.)

1 participant