← All docs
Quickstart
npm install to a working connect box in five minutes. Your user brings the AI account; you never store a key.
1
Install
Zero dependencies. TypeScript types included.
# free in direct mode, forever
npm install @useoutlet/sdk
2
Add a connect box
Your user pastes their own API key. The SDK validates it on their device: wrong-provider keys get a helpful hint, admin keys are refused. Nothing is sent to Outlet or anyone else.
import Outlet from "@useoutlet/sdk";
const session = await Outlet.direct({
keys: { openai: userPastedKey },
});
3
Call the provider like you already do
The session hands you the key back. Use the official SDK; Outlet is never in your data path.
import OpenAI from "openai";
const ai = new OpenAI({ apiKey: session.keys.openai });
4
Keep the key on the device
Direct mode is free because it costs nothing: no server, no storage, no risk. Keep it that way. Hold the key in memory or the browser's encrypted storage, never in your database.
When the vault opens, the paste box becomes a
Connect button and the same session shape carries a capped App key,
scoped to your app inside the user's own account, revocable in one
click. One line changes:
Outlet.direct() becomes
Outlet.connect(). Read the protocol.