spatie/laravel-bluesky-notification-channel
Laravel notification channel for Bluesky (spatie/laravel-bluesky-notification-channel). Send posts via Laravel’s notification system using a simple BlueskyPost builder; automatically detects links, mentions, and hashtags and renders rich text.
via() in notifications). This aligns seamlessly with Laravel’s architecture, requiring minimal deviation from existing patterns.BlueskyPost class, adhering to the Single Responsibility Principle (SRP). This makes it easy to swap or extend functionality (e.g., adding analytics, retry logic).BlueskyPostSent) for post-processing (e.g., logging, analytics).composer require spatie/laravel-bluesky-notification-channel).via(BlueskyChannel::class)).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| API Deprecation | High | Monitor Bluesky’s developer docs and fork the package if needed. |
| Rate Limiting | Medium | Implement Laravel’s queue system (BlueskyChannel::toBluesky()) with exponential backoff. |
| Rich Text Parsing | Low | Test edge cases (e.g., nested links, emojis) in Bluesky’s UI. |
| Authentication | Medium | Securely store API credentials (use Laravel’s env() or vault). |
| Error Handling | Medium | Extend the package to log failed notifications (e.g., via Laravel’s failed events). |
database, redis, or beanstalkd).BlueskyNotificationSent).BlueskyPost for unit/feature tests.guzzlehttp/guzzle (for API calls) – already managed by Laravel.spatie/laravel-package-tools (for package scaffolding) – no direct impact.Mail, Nexmo) to identify candidates for Bluesky integration.BlueskyPost::make().config/services.php:
'bluesky' => [
'api_key' => env('BLUESKY_API_KEY'),
'default_language' => 'en',
],
use Spatie\BlueskyNotificationChannel\BlueskyChannel;
class OrderShipped implements ShouldQueue
{
public function via($notifiable)
{
return [BlueskyChannel::class];
}
public function toBluesky($notifiable)
{
return BlueskyPost::make()
->text("Your order #{$this->orderId} has shipped! Track it here: {$this->trackingUrl}")
->language('en');
}
}
php artisan queue:work --sleep=3 --tries=3
BlueskyChannel exceptions).composer.json constraints).guzzlehttp/guzzle updates may require testing.env() or a secrets manager (e.g., AWS Secrets Manager).BlueskyChannel exceptions.BlueskyPost to include debug flags).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Bluesky API Outage | Notifications fail silently. | Implement a fallback channel (e.g., email). |
| Rate Limiting | Queue backlog or throttled requests. | Use Laravel queues with retries. |
| Invalid API Credentials | All notifications fail. | Validate credentials in a health check. |
| Rich Text Parsing Errors | Malformed posts in Bluesky. | Test |
How can I help you explore Laravel packages today?