Build applications that respond automatically. Raindrop Observers execute code in response to events—file uploads, queue messages, data changes—without polling or complex infrastructure.
Choose the right observer for your event-driven needs
React to data changes
Watch for changes to objects in your buckets and execute code in response. Perfect for processing files after upload, generating thumbnails, or triggering workflows.
application "demo" {
bucket "user-uploads" {}
observer "file-processor" {
source {
bucket = "user-uploads"
rule {
actions = ["PutObject", "CompleteMultipartUpload"]
}
}
}
}
Asynchronous task processing
Process messages as they arrive in queues. Perfect for background jobs, sending notifications, processing payments, or any task that shouldn't block your main flow.
queue "background-jobs" {}
observer "job-processor" {
source { queue = "background-jobs" }
}
See how observers automatically respond to events without complex infrastructure
export default class extends Each<Body, Env> {
async process(message: observers.BucketEventNotification): Promise<void> {
console.log(`Processing file: ${message.key}`);
// Your custom processing logic here
await this.processUploadedFile(message.key);
await this.generateThumbnails(message.key);
await this.updateMetadata(message.key);
}
}
Fine-grained control over which events trigger your observers
React when files are added
React when files are removed
Build reactive applications that respond to events automatically
Automatically generate thumbnails, resize images, and extract metadata when files are uploaded.
Send welcome emails, order confirmations, and status updates without blocking your main application.
Process uploaded data files, generate reports, and update analytics in the background.
Handle payment confirmations, refunds, and subscription renewals asynchronously.
Generate reports, update dashboards, and process analytics data when new information arrives.
Sync data between systems, update caches, and maintain consistency across your application.