@outfitcanvas/fitview-sdk 1.0.1 → 1.0.3
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 +25 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2875 -3091
- package/dist/index.mjs +2875 -3093
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -12,6 +12,10 @@ yarn add @outfitcanvas/fitview-sdk
|
|
|
12
12
|
pnpm add @outfitcanvas/fitview-sdk
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## API key
|
|
16
|
+
|
|
17
|
+
To use the FitView API you need an API key. **Purchase and register at [https://outfitcanvas.app](https://outfitcanvas.app)** to acquire your API key. Use it in the client as shown below.
|
|
18
|
+
|
|
15
19
|
## Quick Start
|
|
16
20
|
|
|
17
21
|
```typescript
|
|
@@ -20,7 +24,7 @@ import { FitViewClient, OutfitCanvasModel } from '@outfitcanvas/fitview-sdk';
|
|
|
20
24
|
// Initialize the client
|
|
21
25
|
const client = new FitViewClient({
|
|
22
26
|
apiKey: 'pk_live_your_api_key_here',
|
|
23
|
-
baseURL: 'https://api.fitview.
|
|
27
|
+
baseURL: 'https://api.fitview.io', // Optional, defaults to production
|
|
24
28
|
});
|
|
25
29
|
|
|
26
30
|
// Generate a virtual try-on
|
|
@@ -53,7 +57,7 @@ Main client class for interacting with the FitView API.
|
|
|
53
57
|
```typescript
|
|
54
58
|
const client = new FitViewClient({
|
|
55
59
|
apiKey: string, // Required: Your API key
|
|
56
|
-
baseURL?: string, // Optional: API base URL (default: https://api.fitview.
|
|
60
|
+
baseURL?: string, // Optional: API base URL (default: https://api.fitview.io)
|
|
57
61
|
timeout?: number, // Optional: Request timeout in ms (default: 300000)
|
|
58
62
|
apiVersion?: string, // Optional: API version (default: 'v1')
|
|
59
63
|
maxRetries?: number, // Optional: Retries for 429/5xx (default: 3, set 0 to disable)
|
|
@@ -528,6 +532,25 @@ The SDK provides specific error classes for different scenarios:
|
|
|
528
532
|
- `FitViewTimeoutError` - Timeout errors
|
|
529
533
|
- `FitViewNetworkError` - Network errors
|
|
530
534
|
|
|
535
|
+
## Troubleshooting
|
|
536
|
+
|
|
537
|
+
### `getaddrinfo ENOTFOUND api.fitview.io` (or similar)
|
|
538
|
+
|
|
539
|
+
This means the hostname of the API could not be resolved (DNS failure). Common causes:
|
|
540
|
+
|
|
541
|
+
1. **Wrong or placeholder base URL** – The default `baseURL` is `https://api.fitview.io`. If your API is hosted elsewhere (e.g. your own Cloud Run URL), set the correct URL when creating the client:
|
|
542
|
+
```typescript
|
|
543
|
+
const client = new FitViewClient({
|
|
544
|
+
apiKey: process.env.FITVIEW_API_KEY!,
|
|
545
|
+
baseURL: process.env.FITVIEW_BASE_URL || 'https://your-actual-api.run.app',
|
|
546
|
+
});
|
|
547
|
+
```
|
|
548
|
+
Or set the `FITVIEW_BASE_URL` environment variable (e.g. `https://fitview-api-xxxxx-uc.a.run.app` without `/api/v1`).
|
|
549
|
+
|
|
550
|
+
2. **Network or DNS issues** – Firewall, VPN, or local DNS may block or fail to resolve the host. Try from another network or verify the API URL in a browser/curl.
|
|
551
|
+
|
|
552
|
+
3. **Custom domain not set up** – If `api.fitview.io` is not yet configured in DNS for your environment, use the actual API URL provided by your dashboard or deployment (e.g. Cloud Run URL) as `baseURL`.
|
|
553
|
+
|
|
531
554
|
## Requirements
|
|
532
555
|
|
|
533
556
|
- Node.js 18.0.0 or higher
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED