Skip to content

feat: added autoRefreshToken client settings#220

Merged
petruki merged 1 commit into
masterfrom
staging
May 18, 2026
Merged

feat: added autoRefreshToken client settings#220
petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented May 18, 2026

This pull request introduces a new feature to the Switcher API JavaScript SDK: automatic API token refresh. It adds an autoRefreshToken option to the client configuration, enabling the SDK to refresh authentication tokens in the background before they expire. The update also includes new tests for this feature, updates to documentation, and dependency/version bumps.

New Feature: Automatic Token Refresh

  • Added autoRefreshToken option to client configuration, allowing tokens to be refreshed automatically before expiry. This is implemented in the Auth class, which schedules token refreshes and handles failures gracefully. [1] [2] [3] [4] [5]

Documentation Updates

  • Updated README.md to document the new autoRefreshToken option and added a Snyk vulnerability badge. [1] [2] [3]

Testing

  • Added comprehensive tests for the token auto-refresh feature, including scenarios for successful refresh, disabled refresh, and refresh failure handling. [1] [2]

Versioning and Dependencies

  • Bumped the SDK version to 4.6.0 in package.json and sonar-project.properties. [1] [2]
  • Updated development dependencies to the latest patch versions.

@petruki petruki added this to the v4.6.0 milestone May 18, 2026
@petruki petruki self-assigned this May 18, 2026
@petruki petruki added the enhancement New feature or request label May 18, 2026
@sonarqubecloud
Copy link
Copy Markdown

@petruki petruki merged commit 93e63eb into master May 18, 2026
23 of 24 checks passed
@petruki petruki deleted the staging branch May 18, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant