JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q92496F
  • License MIT

Server-side InAI Auth client

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/backend

Usage

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 client
  • client.users — User CRUD operations
  • client.sessions — Session management
  • client.tokens — Token verification and rotation
  • client.organizations — Organization management

Documentation

See the full API Reference.

License

MIT