Skip to content

Repository files navigation

DriftLock

Self-maintaining APIs.

API providers announce changes. DriftLock applies them to your codebase.

When Stripe ships a breaking change or a new feature, DriftLock scans your codebase, identifies affected usages, and opens a PR with the fix.

Website · Discord · Issues

npm GitHub stars Build License CodeRabbit Pull Request Reviews


flowchart LR
    A[Vendor API Changes] --> B[DriftLock]
    B --> C[Find Affected Code]
    C --> D[Understand API Diff]
    D --> E[Generate Fix]
    E --> F[Pull Request]
    F --> G[You Review & Merge]
Loading

Why DriftLock

API communication is broken. Breaking changes ship with little warning. Useful features quietly launch and go unnoticed. Changelogs don't get read.

The cost always lands on you (the consumer), not the vendor who made the change.

DriftLock makes APIs self-maintaining. When a vendor changes something, your codebase updates automatically. You review the PR and merge. No manual scanning. No migration guides. No 2am pages.


How it works

flowchart LR
    A[Install GitHub App] --> B[Discover Call Sites]
    B --> C[Classify Tests]
    C --> D[Probe API]
    D --> E[Diff API Shapes]
    E --> F[Generate Fix PR]
    F --> G[Review & Merge]
Loading
Step What happens
Discover Static analysis finds every API call in your codebase
Classify Identifies which tests hit real sandbox vs. mocked
Probe Runs your tests, captures actual request/response shapes
Diff Compares current shapes against target version
Fix Opens PRs with the diffs and suggested fixes
Report Shows which call sites are monitored, blind, or untested

The goal: when Stripe ships a change, your codebase updates automatically. You just review and merge.


Quick start

# Install
bun add -g @driftlock/cli

# Analyze your codebase
driftlock analyze ./src

# Run in sandbox
driftlock test ./repo

# Generate fixes
driftlock fix ./repo

Full documentation →


What you're used to vs. what DriftLock does

Today With DriftLock
Avoid upgrades because they're tedious Automated codebase scanning
Manually find affected call sites All affected calls found automatically
Copy-paste migration guide changes Fix diffs generated and ready to merge
Weeks to upgrade, so you put it off Minutes to review a PR
Stuck on old versions Stay current with minimal effort

Why not Renovate / Dependabot?

They update the version number in package.json. They don't change your code.

When stripe.charges.create({ amount: 100 }) needs to become stripe.charges.create({ value: 100 }), Renovate doesn't touch that. DriftLock does.

Renovate DriftLock
Bumps version Updates your code
Handles npm install Handles call site migration
Dependency management Code migration

Why not just semver?

Semver is a convention, not a guarantee. Many APIs don't follow it strictly. And even when they do, upgrading major versions means manually finding and fixing every affected call site — which is why teams avoid it.

DriftLock works regardless of versioning scheme. It monitors the actual API surface, not the version number.


Why not just test coverage?

High test coverage helps — if your tests aren't mocked. Most are. DriftLock classifies which tests actually hit the real API vs. which just mock the response. You can't catch API drift with mocked tests.


First target: Stripe

Stripe has mature test mode, huge installed base, and plenty of teams stuck on old API versions. First vendor — not the only one.

Twilio, Shopify, and others are on the roadmap.


Security

If you discover a security vulnerability, please report it responsibly.

Email: [email protected]

Do NOT open a public GitHub issue for security vulnerabilities.


Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


Community


License

MIT © DriftLock

About

DriftLock is a tool that detects API changes from vendors (like Stripe) before they break your code. It monitors your actual API usage, compares responses against what the vendor's API returns today, and opens a PR when fields are renamed or removed. Think Dependabot, but for API schema drift instead of dependency versions.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages