https://github.com/use-tusk/drift-node-sdk
Node.js SDK for capturing and replaying API calls made to/from your service
https://github.com/use-tusk/drift-node-sdk
api-testing code-quality mock nodejs test-automation-framework test-generation testing testing-library traffic-replay typescript
Last synced: 5 days ago
JSON representation
Node.js SDK for capturing and replaying API calls made to/from your service
- Host: GitHub
- URL: https://github.com/use-tusk/drift-node-sdk
- Owner: Use-Tusk
- License: apache-2.0
- Created: 2025-10-03T19:59:13.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-01-15T23:01:32.000Z (9 days ago)
- Last Synced: 2026-01-18T00:24:00.897Z (7 days ago)
- Topics: api-testing, code-quality, mock, nodejs, test-automation-framework, test-generation, testing, testing-library, traffic-replay, typescript
- Language: TypeScript
- Homepage: https://www.usetusk.ai/tusk-drift
- Size: 8.58 MB
- Stars: 168
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
The Node.js Tusk Drift SDK enables fast and deterministic API testing by capturing and replaying API calls made to/from your service. Automatically record real-world API calls, then replay them as tests using the [Tusk CLI](https://github.com/Use-Tusk/tusk-drift-cli) to find regressions. During replay, all outbound requests are intercepted with recorded data to ensure consistent behavior without side-effects.

## Documentation
For comprehensive guides and API reference, visit our [full documentation](https://docs.usetusk.ai/api-tests/installation#setup).
### SDK Guides
- [Initialization Guide](docs/initialization.md) - Set up the SDK in your Node.js application
- [Environment Variables](docs/environment-variables.md) - Environment variables reference
- [Quick Start Guide](docs/quickstart.md) - Record and replay your first trace
- [Troubleshooting Guide](docs/troubleshooting.md) - Common issues and solutions


## Requirements
Tusk Drift currently supports the following packages and versions:
- **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`, `mysql@2.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`
If you're using packages or versions not listed above, please create an issue with the package + version you'd like an instrumentation for.
## Installation
### Step 1: Install the CLI
First, install and configure the Tusk Drift CLI by following our [CLI installation guide](https://github.com/Use-Tusk/tusk-drift-cli?tab=readme-ov-file#install). The CLI helps set up your Tusk configuration file and replays tests.
The wizard will eventually direct you back here when it's time to set up the SDK.
### Step 2: Install the SDK
After completing the CLI wizard, install the SDK:
```bash
npm install @use-tusk/drift-node-sdk
```
### Step 3: Initialize the SDK for your service
Refer to our [initialization guide](docs/initialization.md) to set up the SDK for your service.
### Step 4: Run Your First Test
Follow along our [quick start guide](docs/quickstart.md) to record and replay your first test!
## Troubleshooting
Having issues?
- Read our [troubleshooting doc](docs/troubleshooting.md)
- Create an issue or reach us at [support@usetusk.ai](mailto:support@usetusk.ai).
## Community
Join our open source community on [Slack](https://join.slack.com/t/tusk-community/shared_invite/zt-3fve1s7ie-NAAUn~UpHsf1m_2tdoGjsQ).
## Contributing
We appreciate feedback and contributions. See [CONTRIBUTING.md](/CONTRIBUTING.md).
## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.