Skip to content

Commit b1e0fc5

Browse files
authored
change the headers
1 parent 1b5665b commit b1e0fc5

File tree

1 file changed

+14
-15
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+14
-15
lines changed

src/connections/sources/catalog/libraries/website/javascript/index.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -582,25 +582,24 @@ When enabled, Analytics.js automatically retries network and server errors. With
582582

583583
Analytics.js stores events in `localStorage` and falls back to in-memory storage when `localStorage` is unavailable. It retries up to 10 times with an incrementally increasing back-off time between each retry. Analytics.js queues up to 100 events at a time to avoid using too much of the device's local storage. See the [destination Retries documentation](/docs/connections/destinations/#retries) to learn more.
584584

585+
## Delivery strategy configuration
585586

586-
## Headers
587+
## Add custom headers
588+
589+
You can override default headers by providing custom headers in your configuration. Use the `deliveryStrategy.config.headers` option to specify the headers, like in the following example:
587590

588-
### Add custom headers
589-
You can override your headers by custom
590591
```ts
591-
analytics.load("<YOUR_WRITE_KEY>",
592-
{
593-
integrations: {
594-
'Segment.io': {
595-
deliveryStrategy: {
596-
config: {
597-
headers: { 'x-api-key': 'foo' }
598-
},
599-
},
600-
},
601-
},
592+
analytics.load("<YOUR_WRITE_KEY>", {
593+
integrations: {
594+
'Segment.io': {
595+
deliveryStrategy: {
596+
config: {
597+
headers: { 'x-api-key': 'foo' }
598+
}
599+
}
600+
}
602601
}
603-
```
602+
});
604603

605604
## Keepalive
606605

0 commit comments

Comments
 (0)