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

@mst-mkt/mixi2-application-sdk-ts

v1.0.0

Published

mixi2 Application SDK for TypeScript (Unofficial)

Readme

mixi2 Application SDK for TypeScript

Ask DeepWiki Actions: CI License Stargazers

mixi2 の Application API を利用するための TypeScript SDK です。

[!NOTE] この SDK は mixi 公式ではありません。 以下の公式リソースをもとに開発しています。

インストール

npm

npm version License Install size Downloads

pnpm add @mst-mkt/mixi2-application-sdk-ts

JSR

JSR JSR JSR Score

deno add jsr:@mst-mkt/mixi2-application-sdk-ts

Skills

このライブラリを使用するための Skill を公開しています。以下のような方法でインストールできます。

GitHub CLI (gh skill)

gh skill install  mst-mkt/mixi2-application-sdk-ts

vercel-labs/skills (npx skills)

npx skills add mst-mkt/mixi2-application-sdk-ts

環境サポート

このライブラリは以下のランタイム API に依存しており、環境によって利用できる機能が異なります。

| 環境 | auth | client | event/webhook | event/stream | | ------------------ | ------ | -------- | --------------- | -------------- | | Node.js | ✅ | ✅ | ✅ | ✅ | | Deno | ✅ | ✅ | ✅ | ✅ | | Bun | ✅ | ✅ | ✅ | ✅ | | Cloudflare Workers | ✅ | ⚠️ | ✅ | ❌ |

  • Node.js: 18.4.0 以降 (recommended: 22 以降)
    • crypto.subtle: 18.4.0 以降 (ref: https://nodejs.org/en/blog/release/v18.4.0#notable-changes)
    • node:http2: 10.10.0 以降 (ref: https://nodejs.org/en/blog/release/v10.10.0#notable-changes)
    • v20 は既に EOL のため、engines.node は v22 以降を指定している。
  • Deno: 1.26.0 以降
    • crypto.subtle: 1.26.0 以降 (ref: https://deno.com/blog/v1.26#webcrypto-secure-curves)
    • node:http2: 1.37.0 以降 (ref: https://deno.com/blog/v1.37#nodejs-compatibility-improvements)
  • Bun: 0.5.7 以降
    • crypto.subtle: 0.5.7 以降 (ref: https://bun.sh/blog/bun-v0.5.7#changelog)
    • node:http2: 1.0.13 以降 (ref: https://bun.sh/blog/bun-v1.0.13#http2-client-support)
  • Cloudflare Workers: 実験的対応
    • crypto.subtle: 2023-04-28 以降 (ref: https://developers.cloudflare.com/workers/platform/changelog/#2023-04-28)
    • node:http2: 非対応 (ref: https://developers.cloudflare.com/workers/runtime-apis/nodejs/#supported-nodejs-apis)

[!TIP] サーバーレス環境ではランタイムが対応していても gRPC ストリーミングが利用できない場合があります。環境に応じて Webhook と gRPC ストリーミングを使い分けてください。

使い方

詳細な使い方については ドキュメント を参照してください。

API クライアント

createAuthenticator で認証情報を設定し、createMixi2Client で API クライアントを作成します。

import { createAuthenticator, createMixi2Client } from '@mst-mkt/mixi2-application-sdk-ts'

const authenticator = createAuthenticator({
  clientId: CLIENT_ID,
  clientSecret: CLIENT_SECRET,
})

const client = createMixi2Client({ authenticator })

const { posts } = await client.getPosts({ postIdList: ['5efb4595-fe2d-4c52-b078-b85020385955'] })

API クライアントの詳細 >
Plugin 固有の API の詳細 >

イベント処理

mixi2 からのイベント (投稿作成, チャット受信, コミュニティ関連) を処理するハンドラーを定義します。Webhook と gRPC ストリーミングの両方で共通のハンドラーを利用できます。

import { createEventHandler } from '@mst-mkt/mixi2-application-sdk-ts'

const eventHandler = createEventHandler({
  chatMessageReceived: async ({ message }) => {
    // チャット受信時の処理
  },
  postCreated: async ({ post }) => {
    // 投稿 (引用, メンション, リプライ, コミュニティへの投稿) 作成時の処理
  },
  communityMemberChanged: async ({ community, member }) => {
    // コミュニティのメンバー参加・退出時の処理 (Plugin のみ)
  },
  communityPluginManaged: async ({ community }) => {
    // Plugin のコミュニティへの導入・削除時の処理 (Plugin のみ)
  },
})

イベント処理の詳細 >

Webhook

イベントハンドラーと署名検証用の公開鍵から Webhook ハンドラーを作成します。返り値は (req: Request) => Promise<Response> 型の関数で、Web 標準の Request / Response を使う任意の環境で動作します。

import { createWebhookHandler } from '@mst-mkt/mixi2-application-sdk-ts'

const webhookHandler = createWebhookHandler(
  { signaturePublicKey: SIGNATURE_PUBLIC_KEY },
  eventHandler,
)

Webhook の詳細 >

gRPC Stream

イベントハンドラーと認証情報から gRPC ストリーミングのウォッチャーを作成します。watch()AbortSignal を渡すことで、任意のタイミングで監視を停止できます。

import { createStreamWatcher } from '@mst-mkt/mixi2-application-sdk-ts'

const streamWatcher = createStreamWatcher({ authenticator }, eventHandler)
await streamWatcher.watch()

gRPC Stream の詳細 >

デプロイ

開発

CONTRIBUTING.md を参照してください。

Used by

ライセンス

Apache License 2.0