Skip to content

Commit 2bf5d1c

Browse files
committed
Document payload size for javascript SDK
1 parent b00b261 commit 2bf5d1c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/collections/_documentation/clients/javascript/config.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,14 @@ Those configuration options are documented below:
299299

300300
: `fetch()` init parameters ([https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)).
301301

302+
Setting `keepalive: true` parameter will allow SDK to send events in `unload` and `beforeunload` handlers.
303+
However, it'll also restrict the size of a single event to 64kB, per [fetch specification](https://fetch.spec.whatwg.org/#http-network-or-cache-fetch) (point 8.5).
304+
302305
Defaults:
303306

304307
```javascript
305308
{
306309
method: 'POST',
307-
keepalive: true,
308310
referrerPolicy: 'origin'
309311
}
310312
```

src/collections/_documentation/clients/javascript/usage.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ The `captureMessage`, `captureException`, `context`, and `wrap` functions all al
127127
Raven.setTagsContext(tags); // Add back the tags you want to keep.
128128
```
129129

130+
**Be aware of maximal payload size** - There are times, when you want to send a whole application state as an extra data.
131+
This can be quite a large object, which can easily weigh more than 200kB, which is currently maximamal payload size of a single event sent to Sentry.
132+
When this happens, you'll get an `HTTP Error 413 Payload Too Large` as the server response or (when `keepalive: true` is set as `fetch` parameter) request will stay in `pending` state forever (eg. in Chrome).
133+
130134
`extra`
131135

132136
: Arbitrary data to associate with the event.

0 commit comments

Comments
 (0)