@strand-js/core 0.1.6 → 0.1.7
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 +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ import { createStrandClient } from '@strand-js/core'
|
|
|
25
25
|
|
|
26
26
|
const client = createStrandClient({
|
|
27
27
|
baseUrl: '/api/strand',
|
|
28
|
+
headers: { 'x-api-key': 'your-token' }, // sent with every request
|
|
28
29
|
retry: { maxAttempts: 3, backoff: 'exponential' },
|
|
29
30
|
contextWindow: { strategy: 'truncate-oldest', maxTokens: 100_000 },
|
|
30
31
|
})
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -182,6 +182,7 @@ var StrandClientImpl = class {
|
|
|
182
182
|
constructor(config) {
|
|
183
183
|
this.config = {
|
|
184
184
|
baseUrl: config.baseUrl.replace(/\/$/, ""),
|
|
185
|
+
headers: config.headers ?? {},
|
|
185
186
|
retry: {
|
|
186
187
|
maxAttempts: config.retry?.maxAttempts ?? 3,
|
|
187
188
|
backoff: config.retry?.backoff ?? "exponential",
|
|
@@ -205,7 +206,8 @@ var StrandClientImpl = class {
|
|
|
205
206
|
method: "POST",
|
|
206
207
|
headers: {
|
|
207
208
|
"Content-Type": "application/json",
|
|
208
|
-
Accept: "text/event-stream"
|
|
209
|
+
Accept: "text/event-stream",
|
|
210
|
+
...this.config.headers
|
|
209
211
|
},
|
|
210
212
|
body,
|
|
211
213
|
signal
|
package/dist/index.mjs
CHANGED
|
@@ -144,6 +144,7 @@ var StrandClientImpl = class {
|
|
|
144
144
|
constructor(config) {
|
|
145
145
|
this.config = {
|
|
146
146
|
baseUrl: config.baseUrl.replace(/\/$/, ""),
|
|
147
|
+
headers: config.headers ?? {},
|
|
147
148
|
retry: {
|
|
148
149
|
maxAttempts: config.retry?.maxAttempts ?? 3,
|
|
149
150
|
backoff: config.retry?.backoff ?? "exponential",
|
|
@@ -167,7 +168,8 @@ var StrandClientImpl = class {
|
|
|
167
168
|
method: "POST",
|
|
168
169
|
headers: {
|
|
169
170
|
"Content-Type": "application/json",
|
|
170
|
-
Accept: "text/event-stream"
|
|
171
|
+
Accept: "text/event-stream",
|
|
172
|
+
...this.config.headers
|
|
171
173
|
},
|
|
172
174
|
body,
|
|
173
175
|
signal
|