Skip to content

docs: integrator guide for embedding rewards into a third-party app - #1107

Merged
joelpeace48-cell merged 2 commits into
FinesseStudioLab:mainfrom
thebabalola:doc/integrator-guide
Aug 6, 2026
Merged

docs: integrator guide for embedding rewards into a third-party app#1107
joelpeace48-cell merged 2 commits into
FinesseStudioLab:mainfrom
thebabalola:doc/integrator-guide

Conversation

@thebabalola

Copy link
Copy Markdown
Contributor

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:

    • Architecture overview (Mermaid diagram: partner app → Trivela API → Soroban contracts)
    • Step 1: SDK & type setup via @trivela/client
    • Step 2: Creating a campaign programmatically
    • Step 3: Registering participant wallets
    • Step 4: Crediting points on user actions via the interact endpoint
    • Step 5: Webhook signature verification using @trivela/webhook-verify (timing-safe HMAC check)
    • Step 6: Frontend ZK proof generation using @trivela/sdk/zk (Web Worker-based prover)
    • Links to the runnable examples in examples/
  • examples/partner-integration/ — new runnable Node.js server with:

    • index.js: a minimal HTTP server with a POST /webhook endpoint (verifies X-Trivela-Signature) and a GET /mock-purchase endpoint (credits points via the Trivela API)
    • README.md: setup and run instructions
    • .env.example: environment template
  • examples/README.md — added the new partner-integration example to the table

Testing / Local Verification

  • Ran npm run format:check locally — all new/modified files pass prettier
  • Confirmed the 2 remaining warnings (SECURITY.md, .github/FUNDING.yml) are pre-existing in upstream/main and unrelated to this PR
  • History audit: git log upstream/main..HEAD --oneline shows exactly one commit by thebabalola, zero cross-account pollution

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
@thebabalola

Copy link
Copy Markdown
Contributor Author

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!

@drips-wave

drips-wave Bot commented Aug 1, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

Comment thread examples/partner-integration/index.js Outdated
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}`);
@thebabalola

Copy link
Copy Markdown
Contributor Author

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.

@joelpeace48-cell
joelpeace48-cell merged commit e411908 into FinesseStudioLab:main Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrator guide: embedding rewards into a third-party app

4 participants