@junyul/node
v1.2.2
Published
Junyul SDK for Node.js — Express/Fastify middleware + server helpers.
Downloads
242
Maintainers
Readme
@junyul/node
Server-side Junyul SDK for Express/Fastify. Re-exports the full @junyul/core API plus:
complyMiddleware({ defaultAssetId })— Express middleware that injects a compliance banner into HTML responses.junyulFastifyPlugin— same for Fastify.attachDisclosure(res, { ... })— helper to write a banner manually.
import express from 'express';
import { init, track, complyMiddleware } from '@junyul/node';
init({ apiKey: process.env.JUNYUL_API_KEY! });
const app = express();
app.use(complyMiddleware({ defaultAssetId: 'chatbot_v1' }));
app.post('/chat', async (req, res) => {
const reply = await track('chatbot_v1', async () => callOpenAI(req.body.message));
res.json({ reply });
});