@seekora-ai/search-sdk 0.1.1 → 0.2.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.
- package/README.md +5 -53
- package/cdn/seekora-sdk.js +8524 -3571
- package/cdn/seekora-sdk.min.js +2 -2
- package/dist/client.d.ts +312 -4
- package/dist/client.js +562 -5
- package/dist/config.d.ts +5 -5
- package/dist/config.js +6 -30
- package/dist/context-collector.d.ts +273 -0
- package/dist/context-collector.js +868 -0
- package/dist/event-queue.d.ts +195 -0
- package/dist/event-queue.js +424 -0
- package/dist/generated/api.d.ts +11010 -0
- package/dist/generated/api.js +2837 -0
- package/dist/generated/base.d.ts +42 -0
- package/dist/generated/base.js +48 -0
- package/dist/generated/common.d.ts +35 -0
- package/dist/generated/common.js +123 -0
- package/dist/generated/configuration.d.ts +98 -0
- package/dist/generated/configuration.js +48 -0
- package/dist/generated/index.d.ts +13 -0
- package/dist/generated/index.js +31 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +10 -2
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -29,70 +29,22 @@ const results = await client.search('laptop', {
|
|
|
29
29
|
await client.trackClick('prod_123', 1, results.searchId);
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Configuration
|
|
33
33
|
|
|
34
|
-
The SDK
|
|
34
|
+
The SDK uses the production API by default (`https://api.seekora.com/api`).
|
|
35
35
|
|
|
36
|
-
###
|
|
36
|
+
### Custom Base URL
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
// Local development
|
|
40
|
-
const client = new SeekoraClient({
|
|
41
|
-
storeId: 'your-store-id',
|
|
42
|
-
readSecret: 'your-read-secret',
|
|
43
|
-
environment: 'local', // Uses http://localhost:3000
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// Staging
|
|
47
|
-
const client = new SeekoraClient({
|
|
48
|
-
storeId: 'your-store-id',
|
|
49
|
-
readSecret: 'your-read-secret',
|
|
50
|
-
environment: 'stage', // Uses https://stage-api.seekora.ai
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// Production
|
|
54
|
-
const client = new SeekoraClient({
|
|
55
|
-
storeId: 'your-store-id',
|
|
56
|
-
readSecret: 'your-read-secret',
|
|
57
|
-
environment: 'production', // Uses https://api.seekora.com
|
|
58
|
-
});
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Option 2: Environment Variable
|
|
62
|
-
|
|
63
|
-
Set the `SEEKORA_ENV` environment variable:
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
# Local development
|
|
67
|
-
SEEKORA_ENV=local node your-app.js
|
|
68
|
-
|
|
69
|
-
# Staging (default)
|
|
70
|
-
SEEKORA_ENV=stage node your-app.js
|
|
71
|
-
|
|
72
|
-
# Production
|
|
73
|
-
SEEKORA_ENV=production node your-app.js
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Option 3: Custom Base URL
|
|
38
|
+
To use a custom API endpoint (e.g. your own deployment), pass `baseUrl`:
|
|
77
39
|
|
|
78
40
|
```typescript
|
|
79
41
|
const client = new SeekoraClient({
|
|
80
42
|
storeId: 'your-store-id',
|
|
81
43
|
readSecret: 'your-read-secret',
|
|
82
|
-
baseUrl: 'https://
|
|
44
|
+
baseUrl: 'https://your-api.example.com/api',
|
|
83
45
|
});
|
|
84
46
|
```
|
|
85
47
|
|
|
86
|
-
## Available Environments
|
|
87
|
-
|
|
88
|
-
| Environment | Base URL | Description |
|
|
89
|
-
|------------|----------|-------------|
|
|
90
|
-
| `local` | `http://localhost:3000` | Local development |
|
|
91
|
-
| `stage` | `https://stage-api.seekora.ai` | Staging (default) |
|
|
92
|
-
| `production` | `https://api.seekora.com` | Production |
|
|
93
|
-
|
|
94
|
-
**Default:** `stage` (staging environment)
|
|
95
|
-
|
|
96
48
|
## API Methods
|
|
97
49
|
|
|
98
50
|
### Search
|