@magicx-eng/ai-autocomplete-react 0.33.0 → 0.33.2
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.
- package/README.md +3 -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
|
-
|
|
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.
|
|
3
|
+
"version": "0.33.2",
|
|
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.
|
|
32
|
+
"@magicx-eng/ai-autocomplete-vanilla": "0.41.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@figma/code-connect": "^1.4.7",
|