@aquarian-metals/coin-moebius-server
v2.0.0
Published
Server-side webhook verification + payment status helpers for Coin Moebius. Node / serverless only — never import in browser bundles.
Maintainers
Readme
@aquarian-metals/coin-moebius-server
Server-side webhook verification + payment status helpers for Coin Moebius.
⚠️ Node / serverless only. Never import this package (or any provider's
./serverentry) from browser code — it will pull Node built-ins likecryptointo your client bundle and likely break the build.
Provides:
registerVerifier(providerId, verifier)andverify(rawBody, headers)— one webhook endpoint that delegates to whichever provider sent the call.createStatusSubscriber(store)— server-side polling helper backed by aPaymentStore.createSupabaseStore(config)(subpath import:@aquarian-metals/coin-moebius-server/supabase) — a ready-made Supabase-backedPaymentStore.
Install
Only inside your serverless functions / Node project:
npm install @aquarian-metals/coin-moebius-serverYou'll typically also install the server entries of whichever provider packages you verify (e.g. @aquarian-metals/coin-moebius-stripe) and any provider-specific server SDKs the README calls out (e.g. stripe).
Use
import { verify, registerVerifier } from '@aquarian-metals/coin-moebius-server';
import { createStripeVerifier } from '@aquarian-metals/coin-moebius-stripe/server';
registerVerifier('stripe', createStripeVerifier({ endpointSecret: process.env.STRIPE_SECRET }));
export default async function handler(req) {
const result = await verify(req.body, req.headers);
if (result.status === 'success') {
// fulfill the order
}
return { statusCode: 200 };
}See the main README for the full backend wiring example.
License
MIT — see LICENSE.
