{"_id":"@54startups/aqoon","name":"@54startups/aqoon","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@54startups/aqoon","version":"0.1.0","description":"JavaScript SDK for aqoon — make your knowledge available to any AI","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts","test":"vitest run","test:watch":"vitest","lint":"tsc --noEmit"},"keywords":["aqoon","knowledge","ai","search","mcp","rag"],"author":{"name":"54 Startups Inc.","email":"hello@54startups.com"},"license":"MIT","homepage":"https://aqoon.ai","repository":{"type":"git","url":"git+https://gitlab.com/54startups/aqoon.git"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.0.0","vitest":"^2.0.0"},"engines":{"node":">=18.0.0"},"_id":"@54startups/aqoon@0.1.0","gitHead":"1ac5c363490fb904cfcc09f367a3c83f25c6fcef","bugs":{"url":"https://gitlab.com/54startups/aqoon/issues"},"_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-4PJKxDyO7w6Xi9wAqF8dIKXI/wqPXLSR+Rc5cpINYd4utLCU5X9tGM0rTFVmovWU9aKMqD4CphUvKNx3eQ10Ng==","shasum":"e19b8a55cfa02ea12c1f02ba0a88382ba312b916","tarball":"https://registry.npmjs.org/@54startups/aqoon/-/aqoon-0.1.0.tgz","fileCount":6,"unpackedSize":29455,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBQeECVwp3vlnDvCJYaMYSjk2wCQpMtzEb8U8WE0mWoyAiBUGy8JeiK0DztZjKKV6WrIcqw3R2oZ30hEh3u8/3chaw=="}]},"_npmUser":{"name":"54startups","email":"info@54startups.com"},"directories":{},"maintainers":[{"name":"54startups","email":"info@54startups.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/aqoon_0.1.0_1774141269070_0.8341463306728374"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-22T01:01:08.917Z","0.1.0":"2026-03-22T01:01:09.218Z","modified":"2026-03-22T01:01:09.480Z"},"maintainers":[{"name":"54startups","email":"info@54startups.com"}],"description":"JavaScript SDK for aqoon — make your knowledge available to any AI","homepage":"https://aqoon.ai","keywords":["aqoon","knowledge","ai","search","mcp","rag"],"repository":{"type":"git","url":"git+https://gitlab.com/54startups/aqoon.git"},"author":{"name":"54 Startups Inc.","email":"hello@54startups.com"},"bugs":{"url":"https://gitlab.com/54startups/aqoon/issues"},"license":"MIT","readme":"# aqoon\n\nJavaScript/TypeScript SDK for [aqoon](https://aqoon.ai) — make your knowledge available to any AI.\n\n## Installation\n\n```bash\nnpm install aqoon\n```\n\n## Quick Start\n\n```typescript\nimport { Aqoon } from 'aqoon';\n\nconst client = new Aqoon({ apiKey: 'aqn_your_api_key' });\n\n// Search your knowledge base\nconst results = await client.search('machine learning basics');\nfor (const r of results.results) {\n  console.log(`${r.title} (score: ${r.score.toFixed(3)})`);\n  console.log(`  ${r.content.slice(0, 100)}...`);\n}\n```\n\n## Usage\n\n### Search\n\n```typescript\n// Search all collections\nconst results = await client.search('your query');\n\n// Search a specific collection\nconst results = await client.search('your query', { collection: 'my-docs' });\n\n// Limit results\nconst results = await client.search('your query', { limit: 10 });\n```\n\n### Collections\n\n```typescript\n// List your collections\nconst collections = await client.listCollections();\n\n// Get collection details\nconst collection = await client.getCollection('collection-uuid');\n\n// Subscribe to a public collection\nawait client.subscribe('collection-slug');\n\n// Unsubscribe\nawait client.unsubscribe('collection-slug');\n```\n\n### Documents\n\n```typescript\n// List documents (with optional filters)\nconst docs = await client.listDocuments();\nconst docs = await client.listDocuments({ collection: 'my-docs' });\nconst docs = await client.listDocuments({ tag: 'important' });\n\n// Get document with content and chunks\nconst doc = await client.getDocument('document-uuid');\nconsole.log(doc.content_text);\nfor (const chunk of doc.chunks) {\n  console.log(`  Chunk ${chunk.chunk_index}: ${chunk.content.slice(0, 50)}...`);\n}\n```\n\n### API Keys\n\n```typescript\n// List keys\nconst keys = await client.listKeys();\n\n// Create a full-access key\nconst newKey = await client.createKey('My New Key', { isFullAccess: true });\nconsole.log(`Key: ${newKey.key}`); // Only shown once!\n\n// Create a scoped key\nconst scopedKey = await client.createKey('Scoped Key', {\n  collections: ['docs', 'policies'],\n});\n\n// Revoke a key\nawait client.revokeKey('key-uuid');\n\n// Rotate a key\nconst rotated = await client.rotateKey('key-uuid');\nconsole.log(`New key: ${rotated.key}`);\n```\n\n### Usage Stats\n\n```typescript\n// Aggregate usage across all keys\nconst stats = await client.usage({ days: 7 });\nconsole.log(`Total requests: ${stats.total_requests}`);\n\n// Per-key usage\nconst keyStats = await client.keyUsage('key-uuid', { days: 30 });\n```\n\n## Error Handling\n\n```typescript\nimport { Aqoon, NotFoundError, RateLimitError, AuthenticationError } from 'aqoon';\n\nconst client = new Aqoon({ apiKey: 'aqn_your_key' });\n\ntry {\n  const doc = await client.getDocument('nonexistent-uuid');\n} catch (e) {\n  if (e instanceof NotFoundError) {\n    console.log('Document not found');\n  } else if (e instanceof RateLimitError) {\n    console.log(`Rate limited. Retry after ${e.retry_after}s`);\n  } else if (e instanceof AuthenticationError) {\n    console.log('Invalid API key');\n  }\n}\n```\n\n## Configuration\n\n```typescript\nconst client = new Aqoon({\n  apiKey: 'aqn_your_key',\n  baseUrl: 'https://aqoon.ai', // default\n  timeout: 30000,               // milliseconds, default\n});\n```\n\n## Requirements\n\n- Node.js 18+ (uses native `fetch`)\n- An aqoon account with an API key ([get one here](https://aqoon.ai/keys/))\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-3ad53cab7453644dc0e0465928d6cca4"}