Integrations
Webhooks
Receive real-time notifications for package events.
Webhook Events
package.created- New package createdpackage.updated- Package metadata updatedpackage.deleted- Package deletedversion.published- New version publishedversion.deprecated- Version deprecateddownload.completed- Package downloaded
Creating Webhooks
curl -X POST https://registry.yourcompany.com/v1/workspaces/ws_ID/webhooks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/gameframework",
"events": ["version.published", "download.completed"],
"secret": "your_webhook_secret"
}'Webhook Payload
{
"event": "version.published",
"timestamp": "2025-01-10T14:30:00Z",
"workspace_id": "ws_123",
"package": {
"id": "pkg_456",
"name": "my_package",
"version": "1.2.0"
},
"user": {
"id": "usr_789",
"email": "dev@company.com"
}
}Verifying Webhooks
import 'dart:convert';
import 'package:crypto/crypto.dart';
bool verifyWebhook(String payload, String signature, String secret) {
final hmac = Hmac(sha256, utf8.encode(secret));
final digest = hmac.convert(utf8.encode(payload));
final expected = 'sha256=${digest.toString()}';
return signature == expected;
}Use Cases
- Slack Notifications - Alert team on new versions
- CI/CD Triggers - Trigger builds on publish
- Analytics - Track package usage
- Compliance - Log all package events
Next Steps
- CI/CD Examples - Integration examples