{"_id":"@arqera/sdk","_rev":"2-1248e3b92b6031398545effb243f8d58","name":"@arqera/sdk","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@arqera/sdk","version":"0.1.0","keywords":["ai","governance","compliance","eu-ai-act","audit"],"author":{"name":"ARQERA","email":"api@arqera.io"},"license":"SEE LICENSE IN LICENSE","_id":"@arqera/sdk@0.1.0","maintainers":[{"name":"gashiru","email":"gashiru@live.co.uk"}],"homepage":"https://arqera.io","bugs":{"url":"https://github.com/arqera/arqera-typescript/issues"},"dist":{"shasum":"859f9a87c763b7210fca0ab1de2da37f26eefd98","tarball":"https://registry.npmjs.org/@arqera/sdk/-/sdk-0.1.0.tgz","fileCount":14,"integrity":"sha512-DcU2ovAsxDDUhvp+v9YBS4ILX6c2/zd8YktIWEP641FTHcZq4FLcAepCpRdLLOdeToQxOkSijREANkXQSNYwhw==","signatures":[{"sig":"MEQCIEf23aFH8hNiFN2E8NBYH5C5C4TENQsMcS1tbzB4IPs1AiBi/qx2lTiZhEguHgXcFHfMGA9PCV3mw7WihEGaeQGO+A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23419},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"bfee3a12f0e369588730c59eea06ac9ae347c4fa","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"gashiru","email":"gashiru@live.co.uk"},"repository":{"url":"git+https://github.com/arqera/arqera-typescript.git","type":"git"},"_npmVersion":"11.8.0","description":"ARQERA TypeScript SDK — AI governance that learns","directories":{},"_nodeVersion":"24.13.1","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1771687568742_0.9969944230240699","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@arqera/sdk","version":"0.2.0","description":"TypeScript SDK for ARQERA -- AI governance as an API","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"sideEffects":false,"publishConfig":{"access":"public"},"engines":{"node":">=18"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"vitest run","test:watch":"vitest","lint":"tsc --noEmit","prepublishOnly":"npm run build"},"keywords":["arqera","ai","governance","compliance","trust","evidence","audit","eu-ai-act","sdk","api","typescript"],"author":{"name":"ARQERA","email":"engineering@arqera.io"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/Arqera-IO/ARQERA.git","directory":"sdk/typescript"},"bugs":{"url":"https://github.com/Arqera-IO/ARQERA/issues"},"homepage":"https://arqera.io","devDependencies":{"typescript":"^5.3.0","vitest":"^4.1.8"},"_id":"@arqera/sdk@0.2.0","gitHead":"ecfc7b6e34472e3e52ceda8c02bbc9bd811b2d43","_nodeVersion":"22.14.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-6oiFIyURVG9roLuswtTrgf5gTyCMCmUCxFtZCSf14+DmJaZHsbvI+Xf6WWNr9jk3Vjijz32E+LYWTRmJJpLDmw==","shasum":"f874f69a5838e9bc0255aa3714bf39fa615a62c4","tarball":"https://registry.npmjs.org/@arqera/sdk/-/sdk-0.2.0.tgz","fileCount":47,"unpackedSize":119820,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCVX6Gd+mr4Nfu7KHyUCw2PWrre4/1GggZ9p4v/6paceAIhANahaexe3HlWAVcckqb+OvjXfHxjsDvo5IeQlL+TgooS"}]},"_npmUser":{"name":"gashiru","email":"gashiru@live.co.uk"},"directories":{},"maintainers":[{"name":"gashiru","email":"gashiru@live.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.2.0_1784100471255_0.9220108654401775"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-21T15:26:08.650Z","modified":"2026-07-15T07:27:51.502Z","0.1.0":"2026-02-21T15:26:08.891Z","0.2.0":"2026-07-15T07:27:51.387Z"},"bugs":{"url":"https://github.com/Arqera-IO/ARQERA/issues"},"author":{"name":"ARQERA","email":"engineering@arqera.io"},"license":"Apache-2.0","homepage":"https://arqera.io","keywords":["arqera","ai","governance","compliance","trust","evidence","audit","eu-ai-act","sdk","api","typescript"],"repository":{"type":"git","url":"git+https://github.com/Arqera-IO/ARQERA.git","directory":"sdk/typescript"},"description":"TypeScript SDK for ARQERA -- AI governance as an API","maintainers":[{"name":"gashiru","email":"gashiru@live.co.uk"}],"readme":"# @arqera/sdk\n\n**Govern any AI action with one API call.**\n\nThe official TypeScript SDK for [ARQERA](https://arqera.io) -- AI governance as an API. Evaluate actions against governance policies, query trust scores, and maintain a tamper-evident audit trail, all from TypeScript or JavaScript.\n\n## Installation\n\n```bash\nnpm install @arqera/sdk\n# or\nyarn add @arqera/sdk\n# or\npnpm add @arqera/sdk\n```\n\n**Requirements:** Node.js 18+ (uses native `fetch`). Zero runtime dependencies.\n\n## Quick start\n\n```typescript\nimport { Arqera } from '@arqera/sdk';\n\nconst client = new Arqera({ apiKey: 'ak_live_...' });\n\n// Evaluate an action against governance policies\nconst result = await client.governance.evaluate({\n  action: 'email.send',\n  description: 'Send welcome email to new user',\n});\n\nconsole.log(result.verdict);    // \"proceed\", \"review\", or \"deny\"\nconsole.log(result.confidence); // 0.95\nconsole.log(result.approved);   // true\n```\n\n## Governance evaluation\n\nEvery AI action -- sending an email, deleting data, deploying a model -- can be\nevaluated against ARQERA's governance laws before execution:\n\n```typescript\nimport { Arqera, ArqeraError } from '@arqera/sdk';\n\nconst client = new Arqera({ apiKey: 'ak_live_...' });\n\n// Simple evaluation\nconst result = await client.governance.evaluate({ action: 'data.export' });\n\n// With full context\nconst detailed = await client.governance.evaluate({\n  action: 'model.deploy',\n  description: 'Deploy sentiment model to production',\n  context: {\n    model_id: 'sentiment-v3',\n    environment: 'production',\n    user_role: 'ml-engineer',\n  },\n});\n\nif (detailed.approved) {\n  deployModel();\n} else {\n  console.log(`Blocked: ${detailed.reasons}`);\n}\n```\n\n### Verdict object\n\nThe `evaluate()` method returns a `Verdict` with these fields:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `verdict` | `string` | `\"proceed\"`, `\"review\"`, or `\"deny\"` |\n| `action` | `string` | The action that was evaluated |\n| `confidence` | `number` | Confidence score (0.0 -- 1.0) |\n| `reasons` | `string[]` | Reasons supporting the decision |\n| `lawsEvaluated` | `string[]` | Which governance laws were checked |\n| `approved` | `boolean` | Shorthand for `verdict === \"proceed\"` |\n\n## Trust scores\n\nQuery the trust score for your account:\n\n```typescript\nconst trust = await client.governance.trustScore();\nconsole.log(`Overall: ${trust.overall}`);\nconsole.log(`Components:`, trust.components);\n```\n\n## Evidence trail\n\nSearch and export the tamper-evident audit trail:\n\n```typescript\n// Search recent evidence\nconst artifacts = await client.governance.searchEvidence({\n  artifactType: 'governance_evaluation',\n  startDate: '2026-01-01',\n  pageSize: 20,\n});\nfor (const artifact of artifacts) {\n  console.log(`${artifact.artifactType}: ${artifact.createdAt}`);\n}\n\n// Verify chain integrity\nconst verification = await client.governance.verifyEvidence(42);\n\n// Export for compliance audit\nconst exported = await client.governance.exportEvidence({\n  exportFormat: 'json',\n  artifactTypes: ['governance_evaluation'],\n});\n```\n\n## Error handling\n\n```typescript\nimport { Arqera, ArqeraError, RateLimitError, AuthenticationError } from '@arqera/sdk';\n\nconst client = new Arqera({ apiKey: 'ak_live_...' });\n\ntry {\n  const result = await client.governance.evaluate({ action: 'email.send' });\n} catch (err) {\n  if (err instanceof AuthenticationError) {\n    console.error('Invalid API key');\n  } else if (err instanceof RateLimitError) {\n    console.error(`Rate limited. Retry after ${err.retryAfter}s`);\n  } else if (err instanceof ArqeraError) {\n    console.error(`API error (${err.statusCode}): ${err.message}`);\n  }\n}\n```\n\n### Exception hierarchy\n\n| Error | HTTP Status | When |\n|-------|-------------|------|\n| `AuthenticationError` | 401 | Invalid or missing API key |\n| `AuthorizationError` | 403 | Key lacks required permissions |\n| `NotFoundError` | 404 | Resource does not exist |\n| `ValidationError` | 422 | Invalid request payload |\n| `RateLimitError` | 429 | Rate limit exceeded |\n| `ServerError` | 5xx | ARQERA server error |\n| `NetworkError` | -- | DNS, timeout, connection refused |\n| `ArqeraError` | any | Base class for all SDK errors |\n\n## Configuration\n\n```typescript\nconst client = new Arqera({\n  apiKey: 'ak_live_...',                          // or set ARQERA_API_KEY env var\n  baseUrl: 'https://api.arqera.com/api/v1',       // default\n  timeout: 30_000,                                 // milliseconds\n  maxRetries: 2,                                   // retries on 429/5xx\n});\n```\n\nThe `apiKey` can be omitted if the `ARQERA_API_KEY` environment variable is set:\n\n```bash\nexport ARQERA_API_KEY=\"ak_live_...\"\n```\n\n```typescript\nconst client = new Arqera(); // picks up ARQERA_API_KEY from env\n```\n\n## TypeScript support\n\nFull type definitions are included. All types are exported for use in your application code:\n\n```typescript\nimport type { Verdict, TrustScore, EvidenceArtifact, EvaluateOptions } from '@arqera/sdk';\n```\n\n## Links\n\n- [Documentation](https://docs.arqera.io)\n- [API Reference](https://docs.arqera.io/api)\n- [Dashboard](https://app.arqera.io)\n\n## License\n\nApache 2.0. See [LICENSE](LICENSE) for details.\n","readmeFilename":"README.md"}