Installation

Usage

The AuthKit JavaScript SDK provides a client-side library for integrating AuthKit authentication into vanilla JavaScript applications.

Refer to the AuthKit documentation for detailed usage instructions and examples.

Beta Versions

Certain WorkOS features may be available only in the beta version of the SDK. Beta versions have the -beta.* suffix, for example, 3.2.0-beta.1. For more information on how to use the beta versions, refer to the README in the GitHub repository.

Releases

January 15, 2026

v0.19.0

Latest
January 15, 2026

What's Changed

  • Stop unnecessarily setting screen_hint=sign-in by @cmatheson in #107
  • Clear session organization on sign out or refresh error by @nholden in #110

Full Changelog: v0.18.0...v0.19.0

January 8, 2026

v0.18.0

January 8, 2026

What's Changed

  • fix: handle signOut() when no session exists by @nicknisi in #104
  • v0.18.0 by @nicknisi in #106

Full Changelog: v0.17.0...v0.18.0

December 23, 2025

v0.17.0

December 23, 2025

What's Changed

  • feat: enable npm Trusted Publishers by @nicknisi in #101
  • Add authentication method to response interfaces and serializer by @ohjonah in #99

New Contributors

  • @ohjonah made their first contribution in #99

Full Changelog: v0.16.0...v0.17.0

November 13, 2025

v0.16.0

November 13, 2025

What's Changed

  • Revert emitting custom event with access token by @chaance in #96

Full Changelog: v0.15.0...v0.16.0

November 13, 2025

v0.15.0

November 13, 2025

What's Changed

  • Emit custom event when token is refreshed by @chaance in #51

New Contributors

  • @chaance made their first contribution in #51

Full Changelog: v0.14.0...v0.15.0

September 17, 2025

v0.14.0

September 17, 2025

What's Changed

  • Add roles to JWT payload by @atainter in #93
  • v0.14.0 by @atainter in #94

New Contributors

  • @atainter made their first contribution in #93

Full Changelog: v0.13.0...v0.14.0

June 18, 2025

v0.13.0

June 18, 2025

What's Changed

  • Add feature_flags claim on jwt interface by @kkajla12 in #89

Full Changelog: v0.12.0...v0.13.0

May 28, 2025

v0.12.0

May 28, 2025

What's Changed

  • Add support for custom claims in getClaims function by @nicknisi in #87

Full Changelog: v0.11.0...v0.12.0

May 21, 2025

v0.11.0

May 21, 2025

What's Changed

  • Remove 'impersonation coming soon' error message by @nholden in #80
  • Deprecate context option on getAuthorizationUrl and signIn by @nholden in #83
  • Add forceRefresh option to getAccessToken method by @nicknisi in #85
  • Improve compatibility with hybrid mobile apps by @vdsbenoit in #84
  • v0.11.0 by @nicknisi in #86

New Contributors

  • @nholden made their first contribution in #80
  • @vdsbenoit made their first contribution in #84

Full Changelog: v0.10.1...v0.11.0

April 4, 2025

v0.10.1

April 4, 2025

What's Changed

  • Add coana-guardrail and coana-analysis workflows by @nicknisi in #74
  • Add coana-guardrail and coana-analysis workflows by @nicknisi in #75
  • fix: subsequent refreshes by @nananathanh in #78
  • v0.10.1 by @nicknisi in #79

New Contributors

  • @nananathanh made their first contribution in #78

Full Changelog: v0.10.0...v0.10.1

March 12, 2025

v0.10.0

March 12, 2025

Added

  • Add lastSignInAt to user by @stacurry in #70
  • Add externalId to user interface by @faroceann in #72

Full Changelog: v0.9.0...v0.10.0

January 15, 2025

v0.9.0

January 15, 2025

Added

  • Added returnTo option to signOut by (#67)
January 9, 2025

v0.8.1

January 9, 2025

Fixes

  • properly refreshes the session on page load (#66)
December 31, 2025

v0.8.0

December 31, 2025

Changes

  • Avoids initial refresh when user has no session (#61)

Fixes

  • Throws error instead of returning stale access tokens when offline (#63)
  • Properly exports OnRefreshResponse type
December 11, 2024

v0.7.3

December 11, 2024

Changes

  • export type OnRefreshResponse
December 11, 2024

v0.7.2

December 11, 2024

Changes

  • onRefresh callbacks no longer receive the refresh token (#58)
December 2, 2024

v0.7.1

December 2, 2024

Fixed

  • Avoids an issue where multiple authentication requests could queue up when multiple getAccessToken calls are made when the token needs to be refreshed.
November 11, 2024

v0.7.0

November 11, 2024

Added

  • switchToOrganization can be used to switch a user's active organization.
  • signIn and signUp now take organizationId and loginHint parameters.
November 1, 2024

v0.6.1

November 1, 2024

Fixed

  • Under-the-hood changes to improve the locking and synchronization between tabs during session refresh. (#41)
October 28, 2024

v0.6.0

October 28, 2024

Added

  • Added new refreshBufferInterval option to configure how soon the client will attempt to refresh. (#39)
September 14, 2024

v0.5.1

September 14, 2024

Changed

Updated console error message with more explanation when a code could not be exchanged due to missing codeVerifier.

September 9, 2024

v0.5.0

September 9, 2024

Added context parameter to signIn()/signUp().

August 30, 2024

v0.4.1

August 30, 2024

fixes an issue where we repeatedly attempted to refresh the session after it had already ended.

August 30, 2024

v0.4.0

August 30, 2024

Changes

  • Only proactively refreshes active tabs (inactive tabs will still be refreshed as necessary when getAccessToken is called).
  • Doesn't call onRefreshFailure on the initial refresh request

Fixes

  • authkit-js would previously return stale tokens after a browser lock error

Removes

  • refreshSession (getAccessToken will refresh when necessary)
August 28, 2024

v0.3.0

August 28, 2024
  • Added onRefreshError callback
  • Changed: getAccessToken throws a LoginRequiredError if an access token cannot be returned.
August 14, 2024

v0.2.2

August 14, 2024

Fixes

  • refresh timing (#15)
August 12, 2024

v0.2.1

August 12, 2024

Fixes:

  • Schedules token-refreshing after exchanging authorization code
  • Calls onRefresh() after successful code exchange response
August 8, 2024

v0.2.0

August 8, 2024
  • Added passwordResetToken option for signIn()
August 7, 2024

v0.1.0

August 7, 2024

Added

  • getClaims function to decode access tokens.
  • onRefresh callback that is fired when new authentication responses are received.