Skip to main content

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)

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

Run tusk init in CLI to create your .tusk/config.yaml in the root of your service:
cd <path/to/your/service>
tusk init
You can also 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

If you are only testing out Tusk Drift locally, you can skip creating an API key for now.
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. You will need the API key to initialize the SDK.

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