jsonplug
v1.0.14
Published
Transform your JSON into a fully-typed, real-time database in seconds. No setup, no complexity.
Maintainers
Readme
JSONPLUG 🔌
Transform your JSON into a fully-typed, real-time database in seconds. No setup, no complexity.
What is JSONPLUG?
JSONPLUG is a developer tool that converts your JSON files into powerful, typed databases with real-time updates. Perfect for rapid prototyping, feature flags, A/B testing, and dynamic configurations — on the server side (Node.js, Next.js Server Components/API routes).
Features
- 🚀 Instant Setup - Create a typed database from JSON in seconds
- 🔒 Type Safety - Full TypeScript support with auto-generated types
- ⚡ Real-time Updates - Changes sync instantly across your application
- 🎯 Zero Configuration - Works out of the box with your existing code
- 🖥️ Server-side Only - Node.js environments and Next.js Server Components/API routes
- 🔄 Live Schema - Update your data structure without redeploying
Quick Start
1. Install
npm install jsonplug2. Set Environment Variables
JSONPLUG_FILE_ID="your_file_id"
JSONPLUG_SECRET="your_file_secret"3. Generate Types
npx jsonplug generate4. Use in Your Code (Server-side)
import { init } from "jsonplug";
import { JsonPlugSchema } from "@/types/jsonplug";
const jsonplug = await init<JsonPlugSchema>({
secret: process.env.JSONPLUG_SECRET!,
fileId: process.env.JSONPLUG_FILE_ID!,
});
// Get your data with full type safety (in a server file such as a Next.js Server Component or API route)
const data = await jsonplug.get();
console.log(data.hello); // Fully typed!Use Cases
- Dynamic Databases - Create data structures on the fly
- Feature Flags - Toggle features without redeployment
- A/B Testing - Test configurations in real-time
- Configuration Management - Centralize app settings
- Content Management - Update content without code changes
Documentation
Visit jsonplug.com for complete documentation and examples.
License
MIT
