@mymehq/sdk 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,6 +35,11 @@ interface TokenProvider {
35
35
  onSignOut(handler: () => void): () => void;
36
36
  /** Force a sign-out — clears local storage, fires onSignOut handlers. */
37
37
  signOut(): Promise<void>;
38
+ /** Force a token refresh and return the new access token. Same single-flight
39
+ * semantics as `getAccessToken()`. Consumers calling on a 401 response
40
+ * should use this rather than waiting for the next `getAccessToken()` to
41
+ * hit the proactive window. */
42
+ refresh(): Promise<string>;
38
43
  }
39
44
 
40
45
  /**
@@ -128,7 +128,9 @@ var StoredTokenProvider = class {
128
128
  }
129
129
  return this.refresh();
130
130
  }
131
- /** Single-flight refresh — concurrent callers await the same promise. */
131
+ /** Single-flight refresh — concurrent callers await the same promise.
132
+ * Public so consumers can force a refresh on 401 responses (RFC 6750
133
+ * invalid_token) without waiting for the proactive-refresh window. */
132
134
  async refresh() {
133
135
  if (this.inflightRefresh) return this.inflightRefresh;
134
136
  if (!this.cache) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mymehq/sdk",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -20,7 +20,7 @@
20
20
  "dist"
21
21
  ],
22
22
  "dependencies": {
23
- "@mymehq/shared": "4.2.0"
23
+ "@mymehq/shared": "4.3.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.0.0",