A heartfelt thank you to Dario and Daniela Amodei and the entire Anthropic team for creating transformative AI technology that opens endless possibilities for developers worldwide. Your vision, combined with incredibly accessible pricing, has democratized access to cutting-edge AI and empowered countless innovators to build the future. (No, we weren't asked nor paid in any way for this message - we're just genuinely grateful!)
Build APIs That Can Be Extended Like Never Before
๐ช Hooked API
The extensible API framework for Node.js
Why Hooked API?
Building APIs is easy. Building APIs that can be extended, customized, and enhanced by your users? Thatโs hard. Until now.
Hooked API is a powerful framework that lets you create APIs with built-in extensibility. Your users can hook into any part of your APIโs lifecycle, add custom functionality through plugins, and organize their code with scopes.
๐ Key Features
๐ช Powerful Hook System
Let users intercept and modify behavior at any point in your API's execution
๐ Plugin Architecture
Bundle functionality into reusable plugins with dependencies and lifecycle management
๐ฆ Scoped Methods
Organize API methods into logical scopes (like database tables or resource types)
๐ก๏ธ Built-in Security
Prototype pollution protection, input validation, and frozen configurations
๐ Comprehensive Logging
Multi-level logging with custom loggers and performance tracking
๐ Version Management
Built-in API registry with semver support for smooth migrations
See It In Action
Hereโs how simple it is to create an extensible database API:
import { Api } from 'hooked-api';
// Create your API
const api = new Api({ name: 'my-db', version: '1.0.0' });
// Add methods that can be hooked
api.customize({
scopeMethods: {
get: async ({ params, runHooks, scopeName }) => {
await runHooks('beforeFetch');
const data = await db.fetch(scopeName, params.id);
await runHooks('afterFetch');
return data;
}
}
});
// Users can extend with plugins
api.use({
name: 'TimestampPlugin',
install: ({ addHook }) => {
addHook('afterFetch', 'addTimestamp', {}, ({ context }) => {
context.record.fetchedAt = new Date();
});
}
});
// Create scopes for different resources
api.addScope('users');
api.addScope('posts');
// Use it!
const user = await api.scopes.users.get({ id: 123 });
// user now has fetchedAt timestamp added by the plugin!
Perfect For
Let users customize queries, add computed fields, or implement caching
Allow request/response transformation, retry logic, and custom authentication
Create frameworks where every aspect can be customized by developers
Build CLIs and tools that can be extended with community plugins
What Developers Are Probably Thinking
โFinally, an API framework that doesnโt fight me when I need to add custom behavior. The hook system is brilliant!โ - Senior Developer
โWe replaced our entire homegrown plugin system with Hooked API. Itโs more powerful and our code is cleaner.โ - Tech Lead
โThe scope feature is perfect for our multi-tenant application. Each tenant gets their own customized API behavior.โ - SaaS Founder
Ready to Get Started?
Documentation
๐ Full Documentation
Complete guide with examples, from basic usage to advanced patterns
๐ง API Reference
Detailed API documentation for all methods, handlers, and options
โก Cheatsheet
Quick recipes and code snippets for common tasks
MIT Licensed | Built with โค๏ธ for the Node.js community