API Surface
Current public interface
The examples below match the public API of @qoniai/qoni@0.4.0. This page shows capability boundaries; see Qoni SDK for complete parameters, return types, and error handling.
ts
import { Qoni, QoniScopes } from '@qoniai/qoni'
const qoni = new Qoni({
accessKey: process.env.QONI_ACCESS_KEY!,
secretKey: process.env.QONI_SECRET_KEY!,
})Identity APIs
Identity APIs bind user identity, Agent Profiles, and tool permissions into auditable authorization context.
ts
const { data: authorization } = await qoni.delegateToken({
mode: 'interactive',
agent: 'agent_researcher',
scopes: [QoniScopes.WEB_SEARCH_READ, QoniScopes.WEB_SEARCH_MANAGE],
redirectUri: 'http://localhost:3000/qoni/callback',
state: crypto.randomUUID(),
expiresIn: 1800, // seconds
})
console.log(authorization.authorizationUrl)Authoritative contract
For the full identity endpoints, fields and error codes, see GenAuth's API Reference and SDK Reference — both are verified against the code line by line.
Memory APIs
Memory APIs write, retrieve, explain, and erase user context.
The token below is data.token returned after completeDelegateToken({ grantId, code, state }) finishes:
ts
const { data: context } = await qoni.gumem.recall({
token,
sessionId: 'daily-assistant',
query: 'Find laptops for local LLM work'
})Web Data APIs
Web Data APIs turn the open web into structured input and execute browser actions in sandboxes.
ts
const extractRun = await qoni.doAnything.run({
token,
prompt: 'Open https://example.com/report and return the main content as Markdown.'
})
const page = await extractRun.wait()ts
const searchRun = await qoni.webSearch.run({
token,
prompt: 'agent memory benchmark',
maxResultsPerQuery: 5,
})
const result = await searchRun.wait()Recommended integration order
- Add GenAuth for user and agent authorization boundaries.
- Add GUMem for explainable user context.
- Add Web Agent for live web data and browser action.