docs: integrator guide for embedding rewards into a third-party app - #1107
Conversation
Closes FinesseStudioLab#968 - Added docs/INTEGRATOR_GUIDE.md with a step-by-step walkthrough covering SDK setup, campaign creation, participant registration, interaction crediting, webhook signature verification, and ZK proof-based claims - Added examples/partner-integration/ with a runnable Node.js server demonstrating webhook verification and the interact API flow - Updated examples/README.md to include the new partner-integration example
|
hey @joelpeace48-cell, just opened this PR for issue #968 — added the integrator guide and a runnable example server. happy to tweak anything if it doesn't match what you had in mind! |
|
@thebabalola Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
| try { | ||
| // Timing-safely verify signature using webhook-verify SDK | ||
| const event = constructEvent(rawPayload, signature, WEBHOOK_SECRET); | ||
| console.log(`[Webhook Verified]: Received event type: ${event.type}`); |
|
hey @joelpeace48-cell, quick status update on this one — the CodeQL log injection finding on examples/partner-integration/index.js has already been addressed by @Richiey1 in f26a140, so that alert should be resolved. the remaining '11 workflows awaiting approval' look like GitHub Actions branch-protection / required-reviewer gates rather than code failures. the docs and example server themselves are clean. let me know if there’s a specific approval or change you still want from me before this can merge. |
Closes #968
What this does
Added a step-by-step integration guide showing partners how to embed Trivela rewards end-to-end — from zero to a working integration. Also added a runnable example server to back it up.
What changed
docs/INTEGRATOR_GUIDE.md— new guide covering the full integration journey:@trivela/client@trivela/webhook-verify(timing-safe HMAC check)@trivela/sdk/zk(Web Worker-based prover)examples/examples/partner-integration/— new runnable Node.js server with:index.js: a minimal HTTP server with aPOST /webhookendpoint (verifiesX-Trivela-Signature) and aGET /mock-purchaseendpoint (credits points via the Trivela API)README.md: setup and run instructions.env.example: environment templateexamples/README.md— added the newpartner-integrationexample to the tableTesting / Local Verification
npm run format:checklocally — all new/modified files pass prettierSECURITY.md,.github/FUNDING.yml) are pre-existing inupstream/mainand unrelated to this PRgit log upstream/main..HEAD --onelineshows exactly one commit bythebabalola, zero cross-account pollution