Installation

Get started with Halt in your Python or TypeScript project

Python

Install Halt using pip. The package is published as halt-rate, while the import name stays halt. You can install the base package or include optional dependencies for specific storage backends.

terminalbash
pip install halt-rate

# With specific storage backends
pip install halt-rate[redis]      # Redis (recommended for production)
pip install halt-rate[postgres]   # PostgreSQL
pip install halt-rate[mongodb]    # MongoDB
pip install halt-rate[dynamodb]   # DynamoDB
pip install halt-rate[memcached]  # Memcached

# Observability
pip install halt-rate[otel]       # OpenTelemetry metrics adapter

# All optional extras
pip install halt-rate[all]

Requirements

  • Python 3.8 or higher
  • pip package manager

TypeScript / JavaScript

Install Halt using your preferred package manager. Optional dependencies can be installed separately based on your storage backend choice.

terminalbash
npm install halt-rate
# or
yarn add halt-rate
# or
pnpm add halt-rate

# Optional dependencies (pick the client for your store)
npm install ioredis                         # Redis (recommended for production)
npm install pg                              # PostgreSQL
npm install mongodb                         # MongoDB
npm install @aws-sdk/client-dynamodb       # DynamoDB
npm install memcached                       # Memcached

# Web frameworks (optional peers for the matching adapter)
npm install hono                            # halt-rate/hono  Node + edge runtimes
npm install fastify                         # halt-rate/fastify  preHandler hook
npm install @apollo/server                  # halt-rate/graphql  Apollo plugin

# Observability
npm install @opentelemetry/api              # OpenTelemetry metrics adapter

Requirements

  • Node.js 18 or higher
  • npm, yarn, or pnpm

Verify Installation

After installation, verify that Halt is installed correctly by importing it in your code:

Python

from halt import RateLimiter
print("Halt installed successfully!")

TypeScript

import { RateLimiter } from 'halt-rate';
console.log("Halt installed!");

Next Steps

Now that you have Halt installed, check out the Quick Start guide to add rate limiting to your application.