Clone and deploy the example app

Published on September 2026

Reading Time: 6 Minutes

By Coinpes Team

Open a demo wallet and trade the same 1.95× payout rules — no slideware.

Introduction

The fastest way to ship a branded Partner API front end is to clone the example app that already speaks OAuth, demo/real wallets, charts, contracts, and webhooks. Reskin it, point it at your sandbox client, then deploy the same tree from GitHub to Vercel.

The example lives in this repo at packages/partner-example. It is a Vite React app plus same-origin /api/oauth/start and /api/oauth/token handlers so CLIENT_SECRET never reaches the browser.

Clone the repo

From GitHub, clone brian-kiplagat/indices and install from the monorepo root so the trading SDK resolves as a workspace package.

Clone and install

git clone https://github.com/brian-kiplagat/indices.git
cd indices
pnpm install
pnpm --filter @smartbet/trading-sdk build
cp packages/partner-example/.env.example packages/partner-example/.env

If your organization forks the repo, clone that fork instead. Keep the package path packages/partner-example unless you extract it into its own project.

Register redirect and env

In Referrals, open Apps and create a sandbox OAuth app (partner_test_*). Register the redirect URI exactly. Locally that is http://localhost:5174/callback. On Vercel it is https://<your-app>.vercel.app/callback.

Put these values in packages/partner-example/.env (local) and in the Vercel project env (Production + Preview). Never prefix CLIENT_SECRET with VITE_.

  • CLIENT_ID — sandbox or live OAuth client id
  • CLIENT_SECRET — server-only; used by /api/oauth/token
  • API_BASE_URL — Partner API origin, e.g. https://api.coinpes.com
  • REDIRECT_URI — must match the registered URI character for character
  • OAUTH_SCOPE — include contract:read and contract:write if you show or place timed contracts

Run locally

Dev server

pnpm --filter partner-example dev

Open http://localhost:5174, connect a test Coinpes user, and place a demo contract. Confirm the wallet, chart ticks, and activity list before you change branding.

Reskin the UI

Keep the SDK calls and OAuth routes. Change look and copy in:

  • packages/partner-example/src/index.css — colors, type, layout tokens
  • packages/partner-example/public/ui — logos and icons (dark theme at the root, light theme under public/ui/light)
  • Header copy and product names in src/App.tsx and the ticket/panels under src/components

Leave api/oauth/*.ts and PKCE in place. Those files exist so the secret stays on the server when you deploy.

Deploy from GitHub

In Vercel, import the GitHub repo. Set the project Root Directory to packages/partner-example. The package vercel.json already installs from the monorepo root, builds @smartbet/trading-sdk, then builds the Vite app.

  1. Connect the GitHub repo (or your fork) to Vercel.
  2. Root Directory: packages/partner-example.
  3. Add the same env vars as local, with REDIRECT_URI set to the production callback URL.
  4. Register that production callback on the OAuth client.
  5. Deploy. Connect from the live origin and complete one demo fill before you switch to a partner_live_* client.

Preview deployments get their own origin. Either add each preview callback URI on the OAuth client, or restrict OAuth testing to Production until the URI list is stable.

Contact us

Get help with Coinpes trading and accounts

Whether you are learning contracts on demo, funding a live wallet, or need help with positions and payouts, tell us what you need and our team will follow up.

By submitting this form, you agree to Coinpes's Terms of Use and acknowledge our privacy information.