Prerequisites
- Node.js backend service where the SDK will be installed
- All packages used are present in the “Supported technologies” list below
- Dev/staging environment for initial rollout (recommended)
Overview
Tusk Drift SDK captures real API calls from your service and deterministically replays them to detect regressions. During replay, outbound requests are intercepted and served from recorded data so results are stable, side-effect free, and fast enough for CI.Supported technologies
- HTTP/HTTPS: All versions (Node.js built-in)
- GRPC:
@grpc/grpc-js@1.x(Outbound requests only) - PG:
pg@8.x,pg-pool@2.x–3.x - Firestore:
@google-cloud/firestore@7.x - Postgres:
postgres@3.x - MySQL:
mysql2@3.x - IORedis:
ioredis@4.x-5.x - Upstash Redis:
@upstash/redis@1.x - GraphQL:
graphql@15.x–16.x - Prisma:
prisma@5.x-6.x - JSON Web Tokens:
jsonwebtoken@5.x–9.x - JWKS RSA:
jwks-rsa@1.x–3.x
Setup
1. Install the Tusk CLI
- Linux/macOS
- Windows
2. Create the Tusk Drift config
Runtusk init in CLI to create your .tusk/config.yaml in the root of your service:
.tusk directory and config file if you’d prefer. See the configuration doc for details.
3. Install and initialize the Drift SDK
Install SDK
Get Tusk API key
If you are only testing out Tusk Drift locally, you can skip creating an API key for now.
Initialize SDK
Follow the below instructions for your type of application to complete initialization.- CommonJS Applications
- If you use TypeScript, your application is likely compiled to CommonJS before running, follow these CommonJS instructions.
- ESM Applications
- If your application’s compiled code uses
importor you do not compile your code, follow these ESM instructions.
- If your application’s compiled code uses
- Next.js Applications