diff --git a/docs/directory-sync/api-reference.md b/docs/directory-sync/api-reference.md index 29c22285..d96fba30 100644 --- a/docs/directory-sync/api-reference.md +++ b/docs/directory-sync/api-reference.md @@ -646,3 +646,21 @@ const { data, status } = await directorySyncController.requests.handle( callback ); ``` + +### Batch processing events + +You can enable batch processing of directory sync events instead of receiving events in real-time on your webhook endpoint. Once enabled, Jackson will queue the events and process them in batches. The batch size can be configured using the [DSYNC_WEBHOOK_BATCH_SIZE](/docs/jackson/deploy/env-variables#dsync_webhook_batch_size) environment variable. + +You'll ideally want to run the events processing endpoint on a schedule. You can use a cron job to do this. + + + + +```bash +curl -X POST \ + -H "Authorization: Api-Key YOUR_API_KEY" \ + http://localhost:5225/api/v1/dsync/cron/process-events +``` + + + diff --git a/docs/jackson/deploy/env-variables.md b/docs/jackson/deploy/env-variables.md index 5ce20329..d01e36fa 100644 --- a/docs/jackson/deploy/env-variables.md +++ b/docs/jackson/deploy/env-variables.md @@ -12,7 +12,7 @@ The env vars are only applicable to the Jackson service. If you are using the np ### **HOSTNAME** -If you need to bind to a specific hostname, you can define `HOSTNAME` environment variable. +If you need to bind to a specific hostname, you can define `HOSTNAME` environment variable. For example, if you are planning to use a Docker health check like `wget -q --spider http://localhost:{PORT}/api/health || exit 1` set `HOSTNAME=0.0.0.0` to listen to localhost. ### **HOST_URL** @@ -388,3 +388,11 @@ you need to set the admin root token for Retraced so that we can connect to Retr ### **BOXYHQ_NO_TELEMETRY** or **DO_NOT_TRACK** Set one of these to `1` or `true` to turn off our anonymous analytics. We only track usage events once per day and it does not contain any information that can identify you in any form. + +## Directory Sync + +The following env vars are used to configure the directory sync feature. + +### **DSYNC_WEBHOOK_BATCH_SIZE** + +Enable batch processing of directory sync events. The value represents the number of events to batch together instead of sending each event individually. This requires you to configure a cron job to [process the queued events](/docs/directory-sync/api-reference#batch-processing-events)