@erdoai/ui 0.1.11 → 0.1.13
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 +5 -5
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +31 -9
- package/dist/index.d.ts +31 -9
- package/dist/index.js +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ function App() {
|
|
|
32
32
|
<ErdoProvider
|
|
33
33
|
config={{
|
|
34
34
|
baseUrl: 'https://api.erdo.ai',
|
|
35
|
-
|
|
35
|
+
token: 'scoped-token', // Short-lived token from createToken()
|
|
36
36
|
}}
|
|
37
37
|
>
|
|
38
38
|
<YourApp />
|
|
@@ -51,7 +51,7 @@ Agent invocations must happen on your server to keep your API key secret:
|
|
|
51
51
|
import { ErdoClient } from '@erdoai/server';
|
|
52
52
|
|
|
53
53
|
const client = new ErdoClient({
|
|
54
|
-
authToken: process.env.
|
|
54
|
+
authToken: process.env.ERDO_AUTH_TOKEN, // Secret - never exposed to browser
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
export async function POST(request: Request) {
|
|
@@ -284,15 +284,15 @@ const { zoomDomain, setZoomDomain, resetZoom } = useChartZoom();
|
|
|
284
284
|
|
|
285
285
|
> **Security**: Never use `authToken` on the client side. Your API key must stay server-side only.
|
|
286
286
|
|
|
287
|
-
### With
|
|
287
|
+
### With Scoped Token (Recommended for B2B2C)
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
Scoped tokens are short-lived tokens created via `createToken()` for end users:
|
|
290
290
|
|
|
291
291
|
```tsx
|
|
292
292
|
<ErdoProvider
|
|
293
293
|
config={{
|
|
294
294
|
baseUrl: 'https://api.erdo.ai',
|
|
295
|
-
|
|
295
|
+
token: scopedToken, // Created via ErdoClient.createToken()
|
|
296
296
|
}}
|
|
297
297
|
>
|
|
298
298
|
```
|