Supabase Uygulamaları ve Edge Fonksiyonlarında Kripto Kabul Edin

Sync non-custodial 0.5% USDC, EURC, and USDT subscriptions, AI credit balances, and RLS entitlements directly into Supabase Postgres via Deno Edge Functions.

Integration Details

Version 1.0.0
Last Updated 2026-11-12
Compatibility Supabase Postgres · Deno Edge Functions · Auth RLS
Open-Source Repo v1.0.0 Release
View TypeScript SDK & Examples

How to wire XPayr into Supabase in 5 minutes

  1. Set XPAYR_API_KEY and XPAYR_WEBHOOK_SECRET via supabase secrets set
  2. Create a create-checkout Edge Function passing auth.uid() inside XPayr session metadata
  3. Deploy an xpayr-webhook Edge Function (--no-verify-jwt) verifying X-XPayr-Signature via WebCrypto
  4. Atomically credit Postgres user balances or active_until timestamps enforced by Row Level Security (RLS)

5-Step Supabase Postgres + Deno Edge Function Blueprint

  1. Create an idempotent xpayr_webhook_events(event_id text primary key, session_id text, tx_hash text, created_at timestamptz) table in Supabase Postgres.
  2. Store secrets cleanly with supabase secrets set XPAYR_API_KEY=sk_test_... XPAYR_WEBHOOK_SECRET=whsec_....
  3. In supabase/functions/create-checkout/index.ts, authenticate the caller JWT via supabaseClient.auth.getUser() and call POST https://xpayr.com/api/v1/payments with metadata: { user_id: user.id, plan: "pro" }.
  4. Deploy supabase functions deploy xpayr-webhook --no-verify-jwt so XPayr webhooks reach your Deno handler, then verify X-XPayr-Signature over await req.text() using crypto.subtle.
  5. Execute a single Postgres RPC transaction (service_role key) inserting event_id and incrementing credits or extending subscriptions — triggering instant Supabase Realtime UI updates on the client!

Why AI & SaaS builders on Supabase choose XPayr

Instant Supabase Realtime UI sync

When xpayr-webhook updates Postgres, Supabase Realtime pushes the unlocked Pro badge or credit top-up to the browser immediately.

Sıfır ters ibraz on AI GPU credits

Protect OpenAI, Anthropic, ElevenLabs, and Replicate wrapper apps from stolen-card chargeback wipes.

Atomic Postgres idempotency

Primary-key constraints on event_id and tx_hash guarantee exact-once credit accounting under any retry scenario.

Works with Next.js, Expo & Flutter

Share one Supabase backend across Next.js (/plugins/nextjs), React Native, Flutter, and Chrome extensions (/license-kit).

The Default Non-Custodial Crypto Billing Stack for Supabase SaaS & AI Startups

Supabase has become the backend of choice for AI startups, indie SaaS founders, and mobile/extension developers worldwide. Combining Supabase Auth + Postgres RLS + Deno Edge Functions with XPayr 0.5% non-custodial checkout gives your app borderless stablecoin monetization across 16 blockchains in under 100 lines of TypeScript.

FAQ

Supabase Crypto Billing & Webhook FAQ

By default, Supabase API Gateway expects a Supabase Auth JWT in the Authorization header. Passing --no-verify-jwt allows external webhooks to reach your Deno function, where you cryptographically enforce XPayr X-XPayr-Signature HMAC-SHA256 instead.

Pass metadata: { supabase_user_id: user.id } when creating the XPayr session in your authenticated Edge Function; XPayr returns that exact metadata inside the signed webhook payload.

Yes! Write both Stripe and XPayr webhook handlers to the same user_entitlements or credit_ledger Postgres table with provider = "xpayr" and tx_hash recorded for finance audits.

Yes — run supabase functions serve alongside XPayr /tools/webhook-tester or cloudflared/ngrok tunnels using sk_test_ keys.

Ship 0.5% crypto billing on Supabase in minutes.

Deno WebCrypto webhooks + Postgres RLS + 99.5% doğrudan cüzdan tahsilatıyla otomatikleştirin.