A production-ready Express middleware toolkit for securing, monitoring, and protecting REST APIs.
API Shield is an open-source middleware framework for Express.js that helps developers secure, monitor, and manage their APIs with minimal configuration.
Instead of installing and configuring multiple security libraries individually, API Shield provides a unified and extensible solution that combines essential security features into a single package.
- ✅ Rate Limiting
- ✅ Security Headers
- ✅ Request Logging
- ✅ IP Blocking
- 🚧 JWT Authentication Middleware
- 🚧 Brute Force Protection
- 🚧 API Analytics
- 🚧 Request Validation
- 🚧 Performance Monitoring
- 🚧 Redis Store Support
- 🚧 Custom Security Rules
- 🚧 Plugin Architecture
- 🚧 Dashboard & Metrics
- 🚧 Event Hooks
npm install api-shieldor
yarn add api-shieldimport express from "express";
import apiShield from "api-shield";
const app = express();
app.use(
apiShield({
rateLimit: true,
requestLogger: true,
securityHeaders: true,
blockedIPs: ["192.168.1.100"]
})
);
app.listen(3000);apiShield({
rateLimit: true,
requestLogger: true,
securityHeaders: true,
blockedIPs: [],
});| Option | Type | Default | Description |
|---|---|---|---|
| rateLimit | boolean | false | Enables rate limiting |
| requestLogger | boolean | false | Logs incoming requests |
| securityHeaders | boolean | false | Adds common security headers |
| blockedIPs | string[] | [] | Blocks incoming requests from specified IP addresses |
- Package Initialization
- Rate Limiter
- Security Headers
- Request Logger
- IP Blocking
- JWT Middleware
- Brute Force Protection
- Redis Adapter
- Plugin System
- Metrics Dashboard
- Performance Monitoring
- Comprehensive Test Suite
- GitHub Actions
- npm Publish (v1.0.0)
API Shield aims to become a modular security framework for Express.js by providing production-ready middleware that is lightweight, extensible, and easy to integrate.
- Node.js
- Express.js
- TypeScript
- Jest
- GitHub Actions
Contributions are welcome!
If you'd like to improve API Shield, feel free to:
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a Pull Request
This project is licensed under the MIT License.
If you find this project useful:
- ⭐ Star the repository
- 🐞 Report bugs
- 💡 Suggest new features
- 🤝 Contribute to the project
Made with ❤️ by Saurabh Pande