Skip to main content
Tusk Drift is in beta. Reach out to support@usetusk.ai or join our Slack community for cloud access.

Prerequisites

  • Node.js service (backend) where the SDK will be installed
  • Tusk account with Drift, Business, or Enterprise plan
  • 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
  • GraphQL: graphql@15.x–16.x
  • JSON Web Tokens: jsonwebtoken@5.x–9.x
  • JWKS RSA: jwks-rsa@1.x–3.x
View the complete list of supported packages and versions in our public repo.

Setup

1. Install the Tusk CLI

  • Linux/macOS
  • Windows
curl -fsSL https://raw.githubusercontent.com/Use-Tusk/tusk-drift-cli/main/install.sh | sh

2. Create the Tusk Drift config

Go through our onboarding wizard to create your .tusk/config.yaml in the root of your service:
cd <path/to/your/service>
tusk init
You can manually create the .tusk directory and config file if you’d prefer. See the configuration doc for details.

3. Install and initialize the Drift SDK

Install SDK

npm install @use-tusk/drift-node-sdk

Get Tusk API key

Sign in to the Tusk web app, navigate to Settings > API Keys and click Create key. Name the key (e.g., “Tusk Drift”), copy it on creation, and store it securely.

Initialize SDK

  • 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 import or you do not compile your code, follow these ESM instructions.
  • Next.js Applications