← Alle Integrationen
Tier 2 — Full Deakee partner

SDK

Any Node.js app (Express, Fastify, Hono, …)

For custom stacks, headless setups, or anything that doesn't fit a packaged plugin. Provides the canonical centralized-loyalty primitives (member balances, transaction log, refund clawback) plus the relayer client for bridging on-chain.

npm
npm install @deakee/loyalty-sdk
Quellcode auf GitHub anzeigen →

Zwei Integrationsmodi

Derselbe Plugin-Code unterstützt beide Modi. Starte heute im OAuth2-Modus; ergänze die Brücke später per Config-Flip — keine Datenmigration.

OAuth2-Modus
geplant

Zentralisierte Loyalty in deiner DB, mit Deakee via OAuth2 synchronisiert. Keine Chain, keine Exchange — aber Kunden sehen Salden in Deakee und du kannst Deakee-Voucher akzeptieren.

  • Funktioniert mit dem aktuellen deakee.com/api/oauth/* Backend.
  • Keine Token, keine rechtliche Belastung als Emittent.
  • Upgrade auf Brückenmodus per Config-Flip.
Brückenmodus
geplant

Stelle einen ERC-8063-Vertrag bereit; Kunden können zentralisiertes Guthaben in On-Chain-Token verwandeln und auf der Deakee-Exchange handeln.

  • Bringt Exchange-Listing und Cross-Brand-Einlösung.
  • Benötigt den Deakee-Relayer (noch nicht live).
  • Gleicher Plugin-Code wie OAuth2-Modus — aktivierbar wenn bereit.

Installieren

  1. npm install @deakee/loyalty-sdk
  2. Run the published migrations against your DB to create the loyalty tables.
  3. Use members.credit() in your order-complete logic; bridge.withdraw() from your customer-account UI.
  4. Mount the identity OAuth callback route so customers can link their Deakee wallet.

Beispiel

import { DeakeeLoyalty } from "@deakee/loyalty-sdk";

const loyalty = new DeakeeLoyalty({
  apiKey: process.env.DEAKEE_API_KEY,
  contractAddress: process.env.DEAKEE_CONTRACT,
  db: myKnexInstance,
});

// Centralized earn:
await loyalty.members.credit({
  userId, points: 50, reference: `order_${id}`,
});

// User-initiated bridge to chain:
await loyalty.bridge.withdraw({ userId, amount: 500 });

Wie Deakee sich mit deinem Plugin verbindet

Dein Partner-API-Key authentifiziert Aufrufe an den Deakee-Relayer. Die OAuth2-authorize/token-URLs werden einmal pro Kunde verwendet, um die Wallet-Adresse zu holen (Scope: nur identity).

authorize_urlhttps://deakee.com/oauth2/authorize (scope=identity)
token_urlhttps://deakee.com/oauth2/token
api_base_urlhttps://deakee.com/api/relayer/v1

Konformität prüfen

Vor dem Livegang den offiziellen Konformitäts-Verifier ausführen. Prüft das zentralisierte Ledger, den Identity-OAuth-Flow, das Mint/Burn-Wiring der Brücke und Idempotenz.

npx @deakee/loyalty-verifier \
  --partner-api-key   <your key> \
  --plugin-url        <your plugin URL> \
  --contract-address  <your ERC-8063 contract> \
  --test-user-email   test@example.com

Festgefahren? Lies die vollständige README oder öffne ein Issue unter github.com/deakee/loyalty/issues.