npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@skyloom/blueskyclientmanager

v1.0.1

Published

Combines multiple BlueSky-related clients for different contexts (authenticated, unauthenticated, gateway, direct PDS access, etc.)

Readme

BlueSky Client Manager

A TypeScript utility that combines multiple BlueSky/AT Protocol clients for different contexts, providing a unified way to interact with various endpoints in the BlueSky ecosystem. This is primarily for unauthenticated requests, and does not currently allow custom domain endpoints other than individual PDSs.

Features

  • Multiple pre-configured agents for different BlueSky unauthenticated endpoints:
    • PDS Gateway - For general repo requests directly from users
    • Public API - For unauthenticated requests via CDN
    • AppView API - For specific unauthenticated operations like getting labels
    • PDS Agent Factory - For direct PDS connections to access data not available via gateway

Installation

npm install @skyloom/blueskyclientmanager

Usage Examples

Basic Setup

import { BskyClientManager } from "@skyloom/blueskyclientmanager";

// Initialize with labelers (content warning/moderation labelers you want to receive labels from)
// Format is the DID of labelers
const clientManager = new BskyClientManager([
  "did:plc:e4elbtctnfqocyfcml6h2000",
  "did:plc:4ugewi6aca52a62u62jcc000",
  "did:plc:wkoofae5uytcm7bjncmev000",
]);

Using Different API Endpoints

// Using public unauthenticated API (CDN)
const publicTimeline = await clientManager.publicagent.app.bsky.feed.getTimeline(/*params*/);

// Using AppView for unauthenticated operations
const posts = await clientManager.appview.app.bsky.feed.getPosts({
  uris: ["at://did:plc:abcdefg/app.bsky.feed.post/123456"],
});

const myNotifications = await clientManager.authenticatedAgent.app.bsky.notification.listNotifications();

Direct PDS Access

// For operations that require direct PDS access (like block lists)
const pdsHost = "https://morel.us-east.host.bsky.network";
const pdsAgent = clientManager.pdsagents.getAgent(pdsHost);

// Now you can make calls that might be rejected by the gateway
const blockList = await pdsAgent.com.atproto.repo.listRecords({
  repo: did,
  collection: "app.bsky.graph.listblock",
});

Working with Multiple PDS Instances

// The agent factory manages connections to different PDS servers
const firstPds = clientManager.pdsagents.getAgent("https://morel.us-east.host.bsky.network");
const secondPds = clientManager.pdsagents.getAgent("https://shiitake.us-east.host.bsky.network");

// Each agent is cached and can be retrieved using the same URL
const cachedFirstPds = clientManager.pdsagents.getAgent("https://morel.us-east.host.bsky.network");
// cachedFirstPds === firstPds

API Reference

BskyClientManager

The main class that provides access to different BlueSky API endpoints.

class BskyClientManager {
  public pdsagents: AgentFactory; // Factory for PDS-specific agents
  public pdsgateway: Agent; // Agent for the main PDS gateway
  public publicagent: Agent; // Unauthenticated agent for public API (CDN)
  public appview: Agent; // Unauthenticated agent for AppView API
  public authenticatedAgent: Agent | undefined; // Your authenticated agent

  constructor(labelers: string[]); // Initialize with content labelers
}

AgentFactory

A factory class that manages and caches PDS-specific agents.

class AgentFactory {
  getAgent(pds: string): Agent; // Get or create an agent for a specific PDS
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Created by Skyloom