Package Exports
- @inai-dev/backend
Readme
@inai-dev/backend
Server-side client for the InAI Auth API. Use this package to interact with the auth API from any Node.js or edge runtime.
Installation
npm install @inai-dev/backendUsage
import { createInAIClient } from "@inai-dev/backend";
const client = createInAIClient({
secretKey: process.env.INAI_SECRET_KEY!,
publishableKey: process.env.INAI_PUBLISHABLE_KEY!,
});
// Get a user
const user = await client.users.get(userId);
// List sessions
const sessions = await client.sessions.list({ userId });
// Verify a token
const payload = await client.tokens.verify(token);API
createInAIClient(config)— Creates an authenticated API clientclient.users— User CRUD operationsclient.sessions— Session managementclient.tokens— Token verification and rotationclient.organizations— Organization management
Documentation
See the full API Reference.