Brand-new DTC store on Next.js + Node.js
A Next.js 14 + Express monorepo with the full Tier 2-OAuth2 loop pre-wired: identity sign-in, centralized ledger (MysqlMemberStore or MemoryMemberStore), and an example /api/order webhook that credits on completion. Clone, set env, ship.
Download + unzip. cd plugins/starter && pnpm install.
cp .env.example .env — set DEAKEE_CLIENT_ID, DEAKEE_CLIENT_SECRET, DEAKEE_REDIRECT_URI, DATABASE_URL.
pnpm migrate (creates the deakee_loyalty_* tables).
pnpm dev — visit http://localhost:3000, click 'Sign in with Deakee'.
POST to /api/order with { customerId, totalCents, orderId } to simulate an order; points credit instantly.
插件需要一个 Deakee 合作伙伴 OAuth2 应用 — 几分钟在 deakee.com/partners/oauth2 创建一个。
所有交互都通过标准 OAuth2 — 用户在你店铺点"用 Deakee 登录",授权后回到你这里。
客户积分有两份:一份在你的本地数据库(你完全掌控),一份同步到他们的 Deakee 钱包。
推送积分用 /api/oauth/transfer-tokens — 凭幂等键安全重试。
不涉及区块链 / 加密货币 — 这是普通的 OAuth2 + REST,跟 Stripe Connect 一样简单。