codehooks
v1.2.28
Published
CLI for codehooks.io - complete backend for webhooks and automations
Downloads
168
Readme
Codehooks CLI
Codehooks.io is the complete backend for webhooks and automations. Deploy webhooks, APIs, and automations in minutes with built-in infrastructure.
Why Codehooks?
Built for Webhooks - Production-ready templates for Stripe, Shopify, GitHub, Discord, Twilio, Clerk, Slack and more. Each includes signature verification, event storage, and deploys in under a minute.
AI Coding Friendly - Works seamlessly with Claude, Cursor, and other AI coding assistants. Our llms.txt documentation helps AI agents understand and build on Codehooks instantly.
All-in-One Backend - Database, key-value store, background workers, queues, and authentication all built-in. No more piecing together API Gateway + Lambda + DynamoDB + SQS.
Key Features:
- Instant webhook deployment with automatic event storage
- JavaScript ES6/TypeScript support
- NoSQL database with MongoDB-ish query API
- Simple key/value store with Redis-like API
- Workflow API with state management, automatic retries, and error recovery
- Background CRON-like jobs and persistent worker queues
- Built-in filesystem and secure authentication (API tokens, Auth0 JWT/JWKS)
- AI-friendly development (works seamlessly with Claude, Cursor, and other AI agents)
- Easy CRUD API creation with
app.crudlify()
The CLI is your primary tool for deploying and managing webhooks, automations, and backend services.
Check out the CLI documentation at: https://codehooks.io/docs/cli Check out the developer documentation at: https://codehooks.io/docs
Quick start
Install & sign up / login
% npm install codehooks -gSign up and log in with your Github or Google account.
% codehooks login github
If browser does not open automatically, please paste in this URL in a new browser tab/window:
https://account.codehooks.io/authenticate/github/xxxxx
👏 Authentication complete, <YOUR NAME>!
You are now ready to use the Codehooks CLI. Please close the browser window.Create a new project / data store
% codehooks create myproject
Successfully initialized new project 'myproject-xxxx' in your account
Added new space 'dev' and set it to active
Created example file: /Users/<YOU>/<YOUR PATH>/myproject/index.js
% cd myprojectCreate a webhook with a template
Use production-ready webhook templates for popular services:
% codehooks create mywebhook --template webhook-stripe-minimal
# Or browse templates interactively:
% codehooks create mywebhookAvailable templates include Stripe, Shopify, GitHub, Discord, Twilio, Clerk, Slack and more.
Or create a custom webhook
Quick Webhook Example
/*
* Codehooks webhook example
* Install: npm i codehooks-js
*/
import { app, Datastore } from 'codehooks-js';
// Webhook endpoint for https://<PROJECTID>.api.codehooks.io/dev/webhook
app.post('/webhook', async (req, res) => {
const { body, rawBody } = req; // rawBody needed for signature verification
// Verify webhook signature here (example for Stripe)
// const signature = req.headers['stripe-signature'];
// stripe.webhooks.constructEvent(rawBody, signature, webhookSecret);
// Store the webhook event automatically
const conn = await Datastore.open();
await conn.insertOne('events', {
...body,
receivedAt: new Date(),
});
res.status(200).json({ received: true });
});
// Use Crudlify to create a REST API for any collection
app.crudlify();
// bind to serverless runtime
export default app.init();TypeScript is supported, read more here.
Add dependencies
Add npm packages before compile and deployment.
npm i codehooks-jsDeploy project
% coho deploy
Deploying to Project: myproject-xxxx Space: dev
Deployed Codehook successfullyWebhook endpoint: https://myproject-xxxx.api.codehooks.io/dev/webhook
More info at: https://codehooks.io
