AD
Boost Your Brand on BlueSky—Exclusive banner space to amplify your reach within the BlueSky community.
BSkyInfo LogoBskyInfo
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryArticlesGuidesGlossaryBluesky SDKsSponsor
Submit
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryGuidesGlossaryArticlesBluesky SDKsSponsorSubmit
  1. SDKs
  2. /PHP
  3. /bluesky-notification-channel
innocenzi

bluesky-notification-channel

A PHP SDK for Bluesky and AT Protocol by innocenzi

Bluesky notification channel for the Laravel framework

GitHub Stats

25stars
4forks
5contributors
3open issues

Dates

Created:February 9, 2024
Last updated:March 8, 2025

README

The following content is from bluesky-notification-channel's GitHub repository. All rights reserved by the original author.

Bluesky notification channel

Status   npm

Notification channel implementation to create Bluesky posts using Laravel.

composer require innocenzi/bluesky-notification-channel

 

Configuring credentials

To interact with its API, Bluesky recommends creating an application-specific password instead of using your account's main password. You may generate one in your account settings. Once created, fill your .env accordingly:

BLUESKY_USERNAME=your-handle
BLUESKY_PASSWORD=your-app-password

Add these values to config/services.php:

return [
    // ...
    'bluesky' => [
      'username' => env('BLUESKY_USERNAME'),
      'password' => env('BLUESKY_PASSWORD'),
    ]
];

 

Publishing posts

To create a post, you will need to instruct the notification of your choice to use the BlueskyChannel channel and to implement the corresponding toBluesky method.

This method may return a BlueskyPost instance or a simple string.

final class CreateBlueskyPost extends Notification
{
    public function via(object $notifiable): array
    {
        return [
            BlueskyChannel::class
        ];
    }

    public function toBluesky(object $notifiable): BlueskyPost
    {
        return BlueskyPost::make()
            ->text('Test from Laravel');
    }
}

You may then dispatch the notification:

// Without a notifiable
(new AnonymousNotifiable())->notify(new CreateBlueskyPost);

// With a notifiable
$post->notify(new CreateBlueskyPost);

 

Sessions

Bluesky doesn't provide a way to authenticate requests using classic API tokens. Instead, they only offer a JWT-based authentication system, including an access and a refresh token.

Since these tokens expire, they cannot be stored in the environment. They are generated dynamically by creating and refreshing sessions and they need to be kept for as long as possible.

This notification channel implementation uses a session manager and an identity repository based on Laravel's cache. This may be overriden by swapping NotificationChannels\Bluesky\IdentityRepository\IdentityRepository in the container.

Additionnally, the key used by the cache-based identity repository may be configured by setting the services.bluesky.identity_cache_key option.

 

Embeds

For Bluesky, embeds are a client-side responsibility, which means we have to generate website embeds ourselves.

This notification channel implementation uses Bluesky's own private API, cardyb.bsky.app, to fetch a website's metadata, including an URL to its thumbnail. However, that thumbnail stills has to be uploaded to Bluesky as a blob, so a reference to that blob can be added to the post's embed.

You may disable automatic embed generation by calling withoutAutomaticEmbeds on a BlueskyPost instance, or replace the implementation altogether by swapping NotificationChannels\Bluesky\Embeds\EmbedResolver in the container.

Topics

at-protocolblueskylaravelnotification-channelphp

Related SDKs

shahmal1yevblueskysdk

BlueSky SDK is a comprehensive PHP library designed to seamlessly integrate with the BlueSky social network.

29•PHP
cjrasmussenBlueskyApi

Simple helper for interacting with the Bluesky API/AT protocol

37•PHP
potibmphluesky

An small PHP library for Bluesky social using the AT Protocol.

34•PHP
aazsamirlibphpsky

Libphpsky is a PHP library designed to interact with Bluesky decentralized social media protocol - AT protocol.

5•PHP
sbm12bsky-Pack2List

Converting a BlueSky Starter Pack to User List

25•PHP
socialweb-phpatproto

A PHP library for integrating with and communicating over the AT Protocol

42•PHP

Resources

GitHub Repository

License

MIT

Author

innocenzi
innocenzi

Activity

Last commit: March 8, 2025
Commit frequency: Unknown

Our Sponsors

Your Brand Here!

50K+ engaged viewers every month

Limited spots available!

📧 Contact us via email🦋 Contact us on Bluesky
BSkyInfo LogoBskyInfo

The Most Comprehensive Bluesky Tools Directory

Stay updated with the latest Bluesky tools and ecosystem news 🦋

Bluesky butterfly logo
Quick LinksSubmit a ToolSponsorAboutLegal Information
ToolsFeed DirectoryLabeler DirectorySchedulingAnalyticsAll ToolsCategoriesCollectionsTags
ResourcesArticlesBluesky GuidesBluesky GlossaryBluesky SDKsBluesky ResourcesSkyRaffleMeida Coverage
Our ProductsRaffleBlueAiTeach ToolsLaiewAI affiliate listFirsto

This website may contain affiliate links

© 2025 BskyInfo. All rights reserved.