Webhooks
Learn how to set up and manage Partner.js webhooks for real-time collaboration events and integrations.
Get StartedWhat are Webhooks?
Webhooks are HTTP callbacks used to notify your application about events in Partner.js such as new code collaboration events, user authentication changes, or API usage metrics.
Example Webhook Event
{ "event": "collaboration.create", "timestamp": "1694580000000", "data": { "collaborationId": "abc123xyz", "users": ["user1@example.com", "user2@example.com"], "document": { "id": "doc345", "title": "New Project" } } }
Getting Started
Register Your Webhook
- 1 Go to Partner.js Apps Console
- 2 Select your application and navigate to the Webhooks tab
- 3 Add your endpoint URL with a custom secret
Verify Signature
Each request includes a X-Partner-Signature
header. Validate it using your secret.
JavaScript Example:
const hmac = crypto.createHmac('sha256'); hmac.update(JSON.stringify(body)); const digest = hmac.digest('base64');
Supported Events
Event Type | Description | Example |
---|---|---|
collaboration.create | Triggered when new collaboration starts | 2 users start editing |
document.update | Document content changes | File version updated |
user.invite | User joined a collaboration | New user invited |
Best Practices
Use HTTPS
Always secure your endpoint with HTTPS to protect against eavesdropping.
Validate Signatures
Check the X-Partner-Signature header to prevent tampering.
Retry Logic
Implement retry handling for failed delivery attempts.