@@ -269,7 +269,7 @@ const analytics = new Analytics({
269
269
host: ' https://api.segment.io' ,
270
270
path: ' /v1/batch' ,
271
271
maxRetries: 3,
272
- maxEventsInBatch : 15,
272
+ flushAt : 15,
273
273
flushInterval: 10000,
274
274
// ... and more!
275
275
})
@@ -281,7 +281,7 @@ Setting | Details
281
281
`host` _string_ | The base URL of the API. The default is: "https://api.segment.io"
282
282
`path` _string_ | The API path route. The default is: "/v1/batch"
283
283
`maxRetries` _number_ | The number of times to retry flushing a batch. The default is: `3`
284
- `maxEventsInBatch ` _number_ | The number of messages to enqueue before flushing. The default is: `15`
284
+ `flushAt ` _number_ | The number of messages to enqueue before flushing. The default is: `15`
285
285
`flushInterval` _number_ | The number of milliseconds to wait before flushing the queue automatically. The default is: `10000`
286
286
`httpRequestTimeout` _number_ | The maximum number of milliseconds to wait for an http request. The default is: `10000`
287
287
`disable` _boolean_ | Disable the analytics library for testing. The default is: `false`
@@ -534,17 +534,17 @@ Every method you call **doesn't** result in a HTTP request, but is queued in mem
534
534
535
535
By default, Segment' s library will flush:
536
536
537
- - Every 15 messages (controlled by ` settings.maxEventsInBatch ` ).
537
+ - Every 15 messages (controlled by ` settings.flushAt ` ).
538
538
- If 10 seconds has passed since the last flush (controlled by ` settings.flushInterval` )
539
539
540
540
There is a maximum of ` 500KB` per batch request and ` 32KB` per call.
541
541
542
- If you don' t want to batch messages, you can turn batching off by setting the `maxEventsInBatch ` setting to `1`, like so:
542
+ If you don' t want to batch messages, you can turn batching off by setting the `flushAt ` setting to `1`, like so:
543
543
544
544
```javascript
545
545
const analytics = new Analytics({
546
546
...
547
- maxEventsInBatch : 1
547
+ flushAt : 1
548
548
});
549
549
```
550
550
0 commit comments