@apsingh1134/encrypter-sdk
v2.0.0
Published
Official Field-Level Encryption SDK for Express.js, Mongoose, and Prisma with Dashboard Cloud Sync (v2)
Maintainers
Readme
🛡️ @apsingh1134/encrypter-sdk (v2.0.0)
Official Node.js SDK for Application-Layer Field-Level Encryption with Encrypter Developer Dashboard Cloud Sync.
📚 Documentation Versions
- ⚡ Version 2 Documentation (Integrated Cloud Mode) - Connects using Project API Tokens (
enc_live_...) with zero-downtime policy sync. - 📦 Version 1 Documentation (Standalone Offline Mode) - Standalone mode with local Master Key & local policy object.
🚀 Quickstart Example (SDK v2 Integrated Mode)
import express from 'express';
import mongoose from 'mongoose';
import { encrypter } from '@apsingh1134/encrypter-sdk';
const app = express();
app.use(express.json());
// Initialize SDK in Integrated Mode using Dashboard API Token
const sdk = encrypter({
apiKey: process.env.ENCRYPTER_API_TOKEN || 'enc_live_a8f9b2c3d4e5...',
cloudUrl: 'http://localhost:5000',
pollIntervalMs: 30000
});
const UserSchema = new mongoose.Schema({
name: String,
email: String,
phone: String
});
UserSchema.plugin(sdk.mongoosePlugin);
const User = mongoose.model('User', UserSchema);
app.use('/api/users', sdk.expressMiddleware());
app.listen(3000, () => console.log('🚀 App protected with Encrypter SDK v2!'));📜 License
MIT © Aditya Pratap Singh
