Introduction
Documentation for the @g14o/* npm packages — cache, rate limiting, env validation, and Paystack integrations.
What g14o provides
- @g14o/cache —
createCache()/withCache()with Upstash Redis - @g14o/ratelimit — framework-agnostic rate limiting (
Request/Response) - @g14o/ratelimit-nextjs — Next.js rate limiting (
NextRequest/NextResponse) - @g14o/ratelimit-express — Express rate limiting (middleware and route wrappers)
- @g14o/ratelimit-hono — Hono rate limiting (middleware and route wrappers)
- @g14o/env-core — typesafe environment variables via Standard Schema
- @g14o/paystack — typed Paystack REST SDK
- @g14o/paystack-better-auth — Paystack billing plugin for Better Auth
Quick install
pnpm add @g14o/cache @upstash/redis
pnpm add @g14o/ratelimit @upstash/redis @upstash/ratelimit
pnpm add @g14o/ratelimit-nextjs @upstash/redis @upstash/ratelimit next
pnpm add @g14o/ratelimit-express @upstash/redis @upstash/ratelimit express
pnpm add @g14o/ratelimit-hono @upstash/redis @upstash/ratelimit hono
pnpm add @g14o/env-core zod
pnpm add @g14o/paystack zod
pnpm add @g14o/paystack @g14o/paystack-better-auth better-auth zodSee Installation for per-package setup, or jump to a package guide from the sidebar.
Quick example
import { createCache } from "@g14o/cache";
import { logger } from "@/lib/logger";
import { env } from "@/lib/env";
export const { withCache, invalidateCache } = createCache({
redis: {
url: env.UPSTASH_REDIS_REST_URL,
token: env.UPSTASH_REDIS_REST_TOKEN,
},
logger,
});Press Cmd+K (or Ctrl+K) to search across all documentation pages.