· 2 min read

Real-Time Translation Updates with Webhooks

features architecture webhooks

You publish a translation in LangSyncer. How does your Laravel app know?

Webhooks.

The Flow

  1. You click Publish in LangSyncer
  2. LangSyncer sends a webhook to your app
  3. Your app invalidates its translation cache
  4. Next request fetches fresh translations
  5. Users see the update

Total time: 2-3 seconds.

Setting It Up

Enable webhooks in your .env:

CLI_TRANSLATOR_CLIENT_MODE=live
CLI_TRANSLATOR_CLIENT_WEBHOOK_ENABLED=true

The translator-client package registers a webhook endpoint automatically at /api/translator/webhook.

Available Events

Configure which events trigger webhooks:

| Event | When It Fires | |-------|---------------| | Translations Published | Batch publish (most common) | | Single Translation Updated | Individual edit | | Single Translation Deleted | Individual delete | | Bulk Translations Updated | Bulk operations | | Project Languages Changed | Language config changes |

Most apps only need Translations Published.

Security

Every webhook includes a signature. The translator-client package verifies it automatically. No one can fake a webhook.

Delivery Logs

See every webhook delivery:

  • Timestamp
  • Event type
  • Response code
  • Response time

Failed delivery? Check the logs. We retry automatically for transient failures.

Why Not Polling?

You could poll LangSyncer every minute for changes. But:

  • Wastes resources (99% of polls find nothing)
  • Delays updates by up to 60 seconds
  • Counts against rate limits

Webhooks are instant and efficient.

The Result

Content team updates a translation at 2:00 PM. Users see it at 2:00 PM.

No deployment. No cache clear. No waiting.


Configure webhooks →