App Store Server Notificationsのロゴ

App Store Server Notifications

コミュニティ
khadinakbarlabs
app-store-server-notifications

Set up a signature-verified Apple App Store Server Notifications V2 webhook for subscription events. Use when the user says 'app store server notifications', 'assn', 'subscription webhook', or 'iap webhook'.

概要

公開者khadinakbarlabs
リポジトリexpo-mobile-app-builder
スキル名app-store-server-notifications
スター
3
フォーク
0
同梱ファイル
1
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 1個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    khadinakbarlabsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「App Store Server Notifications」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/khadinakbarlabs/expo-mobile-app-builder/tree/main/skills/app-store-server-notifications
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/khadinakbarlabs/expo-mobile-app-builder.git /tmp/expo-mobile-app-builder
mkdir -p .claude/skills
cp -r /tmp/expo-mobile-app-builder/skills/app-store-server-notifications .claude/skills/app-store-server-notifications
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでApp Store Server Notificationsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にApp Store Server Notificationsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、App Store Server Notificationsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Set Up App Store Server Notifications V2

App Store Server Notifications are signed webhook payloads. Decode-only JWT helpers are not verification. Reject any notification that fails certificate-chain, signature, environment, bundle-ID, or app-ID validation before it can update entitlement state.

Required controls

  • Use Apple's current App Store Server Library and its SignedDataVerifier rather than jsonwebtoken.decode.
  • Load Apple root certificates from a trusted, versioned server-side source.
  • Configure the expected bundle ID, production app Apple ID, and environment explicitly.
  • Verify the outer notification and every nested signed transaction or renewal record you consume.
  • Make event processing idempotent by persisting a verified event identifier before applying state changes.
  • Keep this endpoint server-side. It must never rely on an app-bundled signing key or a client-provided "verified" flag.

Verified handler pattern

ts
import { Environment, SignedDataVerifier } from '@apple/app-store-server-library';

// Explicit public identity supplied by this application's server configuration.
const { bundleId, appAppleId } = getAppStoreNotificationIdentity() ?? {};

if (typeof bundleId !== 'string' || !bundleId.trim() || bundleId !== bundleId.trim() ||
    !Number.isSafeInteger(appAppleId) || appAppleId <= 0) {
  throw new Error('Invalid App Store notification configuration');
}

const verifier = new SignedDataVerifier(
  loadTrustedAppleRootCAs(),
  true,
  Environment.PRODUCTION,
  bundleId,
  appAppleId,
);

export async function POST(req: Request) {
  const body = await req.json().catch(() => null);
  if (!body || typeof body.signedPayload !== 'string') {
    return new Response('Bad request', { status: 400 });
  }

  let notification;
  try {
    notification = await verifier.verifyAndDecodeNotification(body.signedPayload);
  } catch {
    return new Response('Invalid notification', { status: 400 });
  }

  const signedTransaction = notification.data?.signedTransactionInfo;
  if (typeof signedTransaction !== 'string') {
    return new Response('Missing transaction', { status: 400 });
  }

  let transaction;
  try {
    transaction = await verifier.verifyAndDecodeTransaction(signedTransaction);
  } catch {
    return new Response('Invalid transaction', { status: 400 });
  }

  await db.transaction(async (tx) => {
    const eventId = notification.notificationUUID;
    if (!eventId) throw new Error('Verified notification is missing an id');

    const alreadyProcessed = await tx.processedEvents.findUnique({ where: { eventId } });
    if (alreadyProcessed) return;

    await tx.processedEvents.create({ data: { eventId } });
    await applyVerifiedSubscriptionTransition(tx, {
      notificationType: notification.notificationType,
      transactionId: transaction.transactionId,
      originalTransactionId: transaction.originalTransactionId,
    });
  });

  return new Response('OK', { status: 200 });
}

getAppStoreNotificationIdentity is an application-owned server accessor returning the owner's exact App Store Connect bundle ID and positive numeric app Apple ID. These public identifiers are not signing credentials. Supply this configuration explicitly for the consuming app; do not read the plugin installer's environment or accept these values from an incoming webhook. Invalid configuration fails server initialization before any verifier is created.

loadTrustedAppleRootCAs and applyVerifiedSubscriptionTransition are application-owned server helpers. The former must load current Apple roots; the latter must allow only known event-state transitions. Do not replace either with decode-only parsing or a client-provided status.

Environment and testing

  • Use a separate verifier configuration for Sandbox and Production. Production requires the configured app Apple ID.
  • Test invalid signatures, wrong bundle IDs, duplicate events, out-of-order events, refunds, renewals, and retries before enabling customer access changes.
  • Return quickly after recording verified work; queue slow side effects such as email or analytics.

RevenueCat alternative

RevenueCat can forward normalized events, but its webhook must still be authenticated with its current documented verification control before it mutates entitlement state.

Reference

See the current Apple App Store Server Library documentation before implementation. Apple documents SignedDataVerifier.verifyAndDecodeNotification for notification verification.

Verifier configuration and production app-ID requirements checked against Apple's SignedDataVerifier reference on 2026-10-04.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「App Store Server Notifications」では何ができますか?

Set up a signature-verified Apple App Store Server Notifications V2 webhook for subscription events. Use when the user says 'app store server notifications', 'assn', 'subscription webhook', or 'iap webhook'.

TypingMindでApp Store Server Notificationsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。App Store Server Notificationsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにApp Store Server Notificationsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/khadinakbarlabs/expo-mobile-app-builder/tree/main/skills/app-store-server-notificationsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

App Store Server Notificationsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

App Store Server Notificationsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもApp Store Server Notificationsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「App Store Server Notifications」は無料ですか?

はい。khadinakbarlabsがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇