Setup
Create an API key under Developers → API keys, then set your backend address as the Callback URL under Developers → Webhooks.
Required environment variables
| Variable | Description |
|---|---|
TQ_API_KEY | The API key from Developers → API keys Required |
TQ_API_SECRET | The API secret for HMAC signing Required |
Where the SDK plugs into your backend
| Endpoint | Direction | Description |
|---|---|---|
/api/login | Middleware | requireTouchque('LOGIN') on your login route |
/api/transfer | Middleware | requireTouchque('SEND_MONEY') on any sensitive route |
Install the SDK using npm:
npm install @touchque/node. Set up environment variables server-side.Browser and React
Your pages use the browser SDK: npm install @touchque/web (@touchque/web 2.2.0). With React, add the hooks and components too: npm install @touchque/react @touchque/web (@touchque/react 2.1.0). Neither needs your API key or secret: those stay on your server.
Package installation
npm install @touchque/nodeBrowser and React
# Browser (@touchque/web 2.2.0)
npm install @touchque/web
# React (@touchque/react 2.1.0)
npm install @touchque/react @touchque/webClient initialization
import { requireTouchque } from '@touchque/node';
// TQ_API_KEY / TQ_API_SECRET read from the environment automatically —
// no client to construct by hand.Environment settings
# .env
TQ_API_KEY=tq_abc123
TQ_API_SECRET=your_secret_here
# callbackUrl:
# https://yourdomain.com/api/2fa/callback