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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@activityplug/misskey

v1.0.2

Published

Misskey adapter for ActivityPlug.

Readme

@activityplug/misskey

@activityplug/misskey maps the Misskey HTTP and streaming APIs to the ActivityPlug client contract. Use it with @activityplug/core when an application connects directly to Misskey.

Installation

pnpm add @activityplug/misskey
pnpm add @activityplug/core

Node.js 26 or newer is required. Both packages use ECMAScript modules. @activityplug/core is a peer dependency, so choose a compatible version for the application rather than installing a second private copy.

The package root contains the complete public adapter API:

import * as activityplug from "@activityplug/misskey";

Create a client

The adapter accepts an optional webSocket factory. The factory is required for streaming and URL media ingestion, but ordinary HTTP operations do not use it.

import {
  createActivityPlugClient,
  type RemoteAuthority,
  type WebSocketFactory,
} from "@activityplug/core";
import { createMisskeyAdapter } from "@activityplug/misskey";

export function createMisskeyClient(
  origin: string,
  remoteAuthority: RemoteAuthority,
  webSocket?: WebSocketFactory,
) {
  return createActivityPlugClient({
    adapter: createMisskeyAdapter({ webSocket }),
    origin,
    remoteAuthority,
  });
}

The remote authority must use a transport that applies the deployment's origin, DNS, redirect, and response-size policies. See the security model for the transport boundary.

Instance detection returns the software profile and the effective capability set:

const profile = await client.instances.detect();

if (profile.capabilities["timelines.public"].status === "supported") {
  const page = await client.timelines.public({ page: { limit: 20 } });
  console.log(page.nodes);
}

When constructing a direct client for an authenticated WebSocket operation, detect the instance first and pass the trusted result to the operational client:

const detector = createMisskeyClient(origin, remoteAuthority, webSocket);
const profile = await detector.instances.detect();

const client = createActivityPlugClient({
  adapter: createMisskeyAdapter({ webSocket }),
  origin,
  remoteAuthority,
  capabilities: profile.capabilities,
  detectedSoftware: profile.software,
});

Do not populate detectedSoftware from caller input. The ActivityPlug server performs this detection when it resolves a client.

Authentication

The adapter implements two strategies:

  • OAuth authorization code, including dynamic client registration
  • Existing access-token import

Misskey access tokens do not use refresh tokens in this adapter. Store the AuthSession returned by the core authentication service and pass it to authenticated operations. See authentication and sessions for the complete flow.

Supported operations

The adapter maps account lookup and profile updates, followers and following, post creation and deletion, home/public/local/hashtag/list timelines, search, media upload/update/delete, polls, notifications, lists, follow requests, relationships, favourites, boosts, and emoji reactions. Post creation accepts public, unlisted, followers-only, and local visibility.

Important explicit limits include:

  • note editing and edit history are not mapped;
  • peer listing, filters, scheduled posts, and bookmark folders are not mapped;
  • grouped notifications, notification dismissal, portable clearing, and unread counts are not mapped;
  • conversation streaming is not implemented;
  • clip-based Misskey bookmarks are not exposed as portable bookmarks.

Read client.capabilities or the capability set returned by instance detection before selecting optional behavior. Unsupported calls fail with ActivityPlugError code UNSUPPORTED_OPERATION; they do not return an ambiguous empty result.

Streaming and media

Timeline and notification streams require the injected webSocket factory. Authenticated streaming and URL media ingestion also require:

  • a detected Misskey version of 13.14.0 or newer;
  • an HTTPS instance origin and a resulting wss: socket;
  • an explicit credential authority;
  • a factory that writes options.authorization to the WebSocket Authorization header.

The adapter never writes the access token to Misskey's legacy i query parameter. Anonymous timeline streaming does not require version or credential checks, but it still requires the injected factory and its egress policy. URL media ingestion is authenticated and waits for the Misskey streaming event that identifies the uploaded file.

See streaming and media for the factory contract, credential rules, and server-family differences.

Public exports

The package exports:

  • createMisskeyAdapter and the pre-created misskeyAdapter;
  • the misskey factory alias;
  • MisskeyAdapterOptions and response-shape types;
  • accountFromResponse and noteFromResponse mapping helpers.

Use @activityplug/core for the client, sessions, entity types, capability types, errors, and remote-authority types.

Related documentation

License

Licensed under Apache-2.0 OR MIT. See LICENSE-APACHE and LICENSE-MIT.