aiskin-proxy
v0.6.1
Published
Key-hiding server proxy for the WRKS AI Agent API v2 — drop-in handlers for Next.js, Express, Cloudflare Workers and any WinterCG runtime.
Readme
aiskin-proxy
Keep your WRKS API key on the server. A tiny proxy handler that speaks the exact /v2 wire format of the WRKS AI Agent API — so aiskin-core, aiskin-react and the aiskin widget work in the browser with no key exposure.
Part of AIskin (independent SDK, not an official wrks.ai product).
npm install aiskin-proxyNext.js (App Router)
// app/api/aiskin/[...path]/route.ts
import { createAiSkinHandler } from 'aiskin-proxy';
const handler = createAiSkinHandler({
apiKey: process.env.WRKS_API_KEY!,
basePath: '/api/aiskin',
allowAgents: [12, 7], // optional: expose only these agents
allowOrigins: ['https://intranet.company.co.kr'], // optional CORS
});
export { handler as GET, handler as POST, handler as OPTIONS };Cloudflare Workers / Bun / Deno
export default { fetch: createAiSkinHandler({ apiKey: env.WRKS_API_KEY }) };Express / Node http
import { createAiSkinHandler, toNodeHandler } from 'aiskin-proxy';
app.use('/api/aiskin', toNodeHandler(createAiSkinHandler({ apiKey: process.env.WRKS_API_KEY! })));Features: SSE streaming passthrough, X-Chat-Id exposure, agent allowlist, CORS control, per-request actor resolution (resolveActor) for employee-level audit logs with system keys.
MIT © AIskin
