Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

1.9 KB
Raw Blame
<?php

declare(strict_types=1);

namespace App\Services\Social;

/**
 * AT Protocol / Bluesky lexicon identifiers (NSIDs) used across the Bluesky
 * services. Centralized so a typo surfaces as an undefined-constant error
 * instead of a silent runtime "Invalid request" from the API.
 */
final class BlueskyLexicon
{
    public const RESOLVE_HANDLE = 'com.atproto.identity.resolveHandle';

    public const CREATE_RECORD = 'com.atproto.repo.createRecord';

    public const LIST_RECORDS = 'com.atproto.repo.listRecords';

    public const GET_RECORD = 'com.atproto.repo.getRecord';

    public const UPLOAD_BLOB = 'com.atproto.repo.uploadBlob';

    public const CREATE_SESSION = 'com.atproto.server.createSession';

    public const GET_SESSION = 'com.atproto.server.getSession';

    public const REFRESH_SESSION = 'com.atproto.server.refreshSession';

    public const GET_SERVICE_AUTH = 'com.atproto.server.getServiceAuth';

    public const VIDEO_UPLOAD = 'app.bsky.video.uploadVideo';

    public const VIDEO_GET_JOB_STATUS = 'app.bsky.video.getJobStatus';

    public const FEED_POST = 'app.bsky.feed.post';

    public const GET_POSTS = 'app.bsky.feed.getPosts';

    public const GET_POST_THREAD = 'app.bsky.feed.getPostThread';

    public const GET_PROFILE = 'app.bsky.actor.getProfile';

    public const EMBED_IMAGES = 'app.bsky.embed.images';

    public const EMBED_VIDEO = 'app.bsky.embed.video';

    public const EMBED_EXTERNAL = 'app.bsky.embed.external';

    public const FACET_LINK = 'app.bsky.richtext.facet#link';

    public const FACET_MENTION = 'app.bsky.richtext.facet#mention';

    public const FACET_TAG = 'app.bsky.richtext.facet#tag';

    /**
     * The XRPC endpoint of a method on a Bluesky server, e.g. `https://bsky.social/xrpc/com.atproto.server.getSession`.
     */
    public static function xrpc(string $server, string $method): string
    {
        return "{$server}/xrpc/{$method}";
    }
}