@magicx-eng/ai-autocomplete-react 0.33.0 → 0.33.1

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.
Files changed (2) hide show
  1. package/README.md +3 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -647,7 +647,8 @@ A discriminated union: `APIKeyConfig | AccessTokenConfig`.
647
647
  getAccessToken: async () => {
648
648
  const res = await fetch("/api/ac-token");
649
649
  const { access_token, expires_at } = await res.json();
650
- return { accessToken: access_token, expiresAt: expires_at };
650
+ // expires_at is Unix seconds; the SDK's expiresAt is Unix milliseconds.
651
+ return { accessToken: access_token, expiresAt: expires_at * 1000 };
651
652
  },
652
653
  }}
653
654
  onSubmit={handleSubmit}
@@ -663,7 +664,7 @@ A discriminated union: `APIKeyConfig | AccessTokenConfig`.
663
664
  | `appIdentifier?` | `string` | Value for the `X-App-Identifier` header. |
664
665
  | `headers?` | `Record<string, string>` | Additional headers merged into every request. |
665
666
 
666
- The SDK handles token refresh transparently: 401 → `getAccessToken` → retry (once). Concurrent 401s share a single refresh. Tokens refresh proactively 30s before `expiresAt`.
667
+ The SDK handles token refresh transparently: 401 → `getAccessToken` → retry (once). Concurrent 401s share a single refresh. Tokens refresh proactively 30s before `expiresAt` (Unix milliseconds).
667
668
 
668
669
  ### `useAIAutocomplete(options)`
669
670
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicx-eng/ai-autocomplete-react",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "description": "AI Autocomplete React SDK — guided autocomplete with pill-based input and dropdown suggestions",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -29,7 +29,7 @@
29
29
  "react-dom": ">=17.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@magicx-eng/ai-autocomplete-vanilla": "0.39.0"
32
+ "@magicx-eng/ai-autocomplete-vanilla": "0.40.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@figma/code-connect": "^1.4.7",