{"_id":"@astrolinkers/sdk-ts","_rev":"3-fe2b66c42ae6cf840356948a4351b007","name":"@astrolinkers/sdk-ts","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@astrolinkers/sdk-ts","version":"0.1.0","keywords":["astrology","vedic","jyotish","natal-chart","llm","api-client","sdk","typescript"],"author":{"name":"Astrolinkers"},"license":"MIT","_id":"@astrolinkers/sdk-ts@0.1.0","maintainers":[{"name":"fedorello","email":"fedorstartup@gmail.com"}],"homepage":"https://astrolinkers.com","bugs":{"url":"https://github.com/fedorello/astrolinkers-sdk-ts/issues"},"dist":{"shasum":"7b604ace6fee7cb62db8befe36c1f6d064b65bca","tarball":"https://registry.npmjs.org/@astrolinkers/sdk-ts/-/sdk-ts-0.1.0.tgz","fileCount":12,"integrity":"sha512-GCICDRseT91EUCgG3udj3B4JJ3mdiE96USHt2QM8BnfzfsTANt717Rzv2uRL/307jPomVpbF11J7LQpAueRTNQ==","signatures":[{"sig":"MEUCIQDW3s0RChr3a4W5yDCAQmun7ALQMErgwOhk+P/S3wvQtgIgPLDli/8bIViWXOoSGQZ/dlSN8AtczIVgvcRqwouoiBU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@astrolinkers%2fsdk-ts@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":451887},"main":"./dist/index.cjs","pnpm":{"ignoredBuiltDependencies":["msw"]},"type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","engines":{"node":">=18.17.0"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"35285822f5c0dbf86384a0044b3ee829983e597e","scripts":{"ci":"pnpm run lint && pnpm run format:check && pnpm run typecheck && pnpm run test","lint":"eslint .","test":"vitest run","build":"tsdown","format":"prettier --write .","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"fedorello","email":"fedorstartup@gmail.com"},"repository":{"url":"git+https://github.com/fedorello/astrolinkers-sdk-ts.git","type":"git"},"_npmVersion":"11.12.1","description":"Official TypeScript SDK for the Astrolinkers API — natal charts, talent profiles, Vedic calculations, and engine-grounded LLM interpretations.","directories":{},"_nodeVersion":"24.15.0","dependencies":{"zod":"^4.4.3","eventsource-parser":"^3.0.8"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.1.1","devDependencies":{"eslint":"^10.4.0","tsdown":"^0.20.3","vitest":"^4.1.6","prettier":"^3.8.3","@eslint/js":"^9.36.0","typescript":"^6.0.3","@types/node":"^22.10.0","typescript-eslint":"^8.51.0","@vitest/coverage-v8":"^4.1.6","eslint-config-prettier":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-ts_0.1.0_1779160741565_0.752046173361693","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@astrolinkers/sdk-ts","version":"0.1.1","keywords":["astrology","vedic","jyotish","natal-chart","llm","api-client","sdk","typescript"],"author":{"name":"Astrolinkers"},"license":"MIT","_id":"@astrolinkers/sdk-ts@0.1.1","maintainers":[{"name":"fedorello","email":"fedorstartup@gmail.com"}],"homepage":"https://astrolinkers.com","bugs":{"url":"https://github.com/fedorello/astrolinkers-sdk-ts/issues"},"dist":{"shasum":"d199c9a8c1c79c9c207931439a6492b45be3eaa7","tarball":"https://registry.npmjs.org/@astrolinkers/sdk-ts/-/sdk-ts-0.1.1.tgz","fileCount":12,"integrity":"sha512-C3XnQ+xhO2SBlfUfLKdwl6KUv3/Y7KYGMD2xLS0a0rvS5zNLyNRtpclgC3AZun/qtIDXo9GYYFQM5yjtsgXhcg==","signatures":[{"sig":"MEUCIGc8wXOcjlabjgLaFiKqyqJnLrkwDO97YDEa4yYxtpHIAiEA6OU8Dn45434ibuMLebuJmo63pDEeAo1w5XiY39nZwCw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@astrolinkers%2fsdk-ts@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":456032},"main":"./dist/index.cjs","pnpm":{"ignoredBuiltDependencies":["msw"]},"type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","engines":{"node":">=18.17.0"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"585298342dce84a530547206e45b2cc89c0d96e4","scripts":{"ci":"pnpm run lint && pnpm run format:check && pnpm run typecheck && pnpm run test","lint":"eslint .","test":"vitest run","build":"tsdown","format":"prettier --write .","typecheck":"tsc --noEmit","test:watch":"vitest","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cb3ca48b-4126-4d7a-a819-9d95f9ffd7ec"}},"repository":{"url":"git+https://github.com/fedorello/astrolinkers-sdk-ts.git","type":"git"},"_npmVersion":"11.12.1","description":"Official TypeScript SDK for the Astrolinkers API — natal charts, talent profiles, Vedic calculations, and engine-grounded LLM interpretations.","directories":{},"_nodeVersion":"24.15.0","dependencies":{"zod":"^4.4.3","eventsource-parser":"^3.0.8"},"_hasShrinkwrap":false,"packageManager":"pnpm@11.1.1","devDependencies":{"eslint":"^10.4.0","tsdown":"^0.20.3","vitest":"^4.1.6","prettier":"^3.8.3","@eslint/js":"^9.36.0","typescript":"^6.0.3","@types/node":"^22.10.0","typescript-eslint":"^8.51.0","@vitest/coverage-v8":"^4.1.6","eslint-config-prettier":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk-ts_0.1.1_1779164003567_0.8438458178971733","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@astrolinkers/sdk-ts","version":"0.1.2","description":"Official TypeScript SDK for the Astrolinkers API — natal charts, talent profiles, Vedic calculations, and engine-grounded LLM interpretations.","license":"MIT","author":{"name":"Astrolinkers"},"homepage":"https://astrolinkers.com","repository":{"type":"git","url":"git+https://github.com/fedorello/astrolinkers-sdk-ts.git"},"bugs":{"url":"https://github.com/fedorello/astrolinkers-sdk-ts/issues"},"keywords":["astrology","vedic","jyotish","natal-chart","llm","api-client","sdk","typescript"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.mts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"engines":{"node":">=18.17.0"},"scripts":{"build":"tsdown","typecheck":"tsc --noEmit","lint":"eslint .","format":"prettier --write .","format:check":"prettier --check .","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:e2e":"vitest run --config vitest.e2e.config.ts","ci":"pnpm run lint && pnpm run format:check && pnpm run typecheck && pnpm run test"},"dependencies":{"eventsource-parser":"^3.0.8","zod":"^4.4.3"},"devDependencies":{"@eslint/js":"^9.36.0","@types/node":"^22.10.0","@vitest/coverage-v8":"^4.1.6","eslint":"^10.4.0","eslint-config-prettier":"^10.0.0","prettier":"^3.8.3","tsdown":"^0.20.3","typescript":"^6.0.3","typescript-eslint":"^8.51.0","vitest":"^4.1.6"},"packageManager":"pnpm@11.1.1","pnpm":{"ignoredBuiltDependencies":["msw"]},"gitHead":"b45a787e91e877cb84761fa7c3a1640209b6ea71","_id":"@astrolinkers/sdk-ts@0.1.2","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-U6Axk4Leuy8liDo0/iRYMYGBw7PmB+0CJ8Mh/QNxoXBwwzIRiKFsOSt0MMs3kkBYdQGrmbmEAk7K8+SKx9+2Aw==","shasum":"7eb130a12b477a3362970371e9a275c4a025340f","tarball":"https://registry.npmjs.org/@astrolinkers/sdk-ts/-/sdk-ts-0.1.2.tgz","fileCount":12,"unpackedSize":457416,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@astrolinkers%2fsdk-ts@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHqkciw+fyZpM9uPxpa5MxuMcxfBhyGUlGaKMYvcAAM4AiAhzqxByozosvYy7zCAlHkjHhyCu7cuaVIirSiCB35cNQ=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cb3ca48b-4126-4d7a-a819-9d95f9ffd7ec"}},"directories":{},"maintainers":[{"name":"fedorello","email":"fedorstartup@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk-ts_0.1.2_1779197555553_0.17825114637241057"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T03:19:01.495Z","modified":"2026-05-19T13:32:36.018Z","0.1.0":"2026-05-19T03:19:01.868Z","0.1.1":"2026-05-19T04:13:23.767Z","0.1.2":"2026-05-19T13:32:35.727Z"},"bugs":{"url":"https://github.com/fedorello/astrolinkers-sdk-ts/issues"},"author":{"name":"Astrolinkers"},"license":"MIT","homepage":"https://astrolinkers.com","keywords":["astrology","vedic","jyotish","natal-chart","llm","api-client","sdk","typescript"],"repository":{"type":"git","url":"git+https://github.com/fedorello/astrolinkers-sdk-ts.git"},"description":"Official TypeScript SDK for the Astrolinkers API — natal charts, talent profiles, Vedic calculations, and engine-grounded LLM interpretations.","maintainers":[{"name":"fedorello","email":"fedorstartup@gmail.com"}],"readme":"# Astrolinkers TypeScript SDK\n\nOfficial TypeScript / JavaScript client for the\n[Astrolinkers API](https://astrolinkers.com) — natal charts, talent\nprofiles, Vedic calculations, and engine-grounded LLM interpretations.\n\n- **Async-first** single client (`Astrolinkers`) — Node 18+, Bun,\n  Cloudflare Workers, modern browsers.\n- **Fully typed** — Pydantic-equivalent Zod schemas, ESM + CJS\n  output with `.d.mts` / `.d.cts` declarations.\n- **Streaming** of LLM interpretations as a typed async iterator.\n- **Retry-aware** — honours `Retry-After`, jittered exponential\n  backoff on transient failures.\n- **Multilingual** — English plus 8 Indian languages + Spanish.\n\n> Status: alpha (`0.1.0`). Public API may shift between minor\n> releases until `1.0`. Pin the minor version.\n\n---\n\n## Install\n\n```bash\nnpm  install @astrolinkers/sdk-ts\npnpm add     @astrolinkers/sdk-ts\nyarn add     @astrolinkers/sdk-ts\n```\n\nRequires Node 18+ (uses global `fetch`).\n\n## Resource map\n\n| Resource                 | Wraps                                         | Notes                                                                                |\n| ------------------------ | --------------------------------------------- | ------------------------------------------------------------------------------------ |\n| `client.charts`          | `/v1/charts`                                  | Compute / fetch natal charts.                                                        |\n| `client.llm`             | `/v1/llm/...` (sync + stream)                 | LLM interpretations + persistence + usage summary.                                   |\n| `client.interpretations` | `/v1/interpretations`                         | Template-driven flow + statements.                                                   |\n| `client.compatibility`   | `/v1/compatibility`                           | Synastry + ashtakoota between two charts.                                            |\n| `client.feedback`        | `/v1/feedback`                                | Statement verdicts + template accuracy.                                              |\n| `client.profiles`        | `/v1/charts/{id}/profile/talent`              | Talent / hiring skill profile.                                                       |\n| `client.reports`         | `/v1/reports`                                 | Async PDF / HTML report generation.                                                  |\n| `client.vedic`           | 58 × `/v1/vedic/...`                          | Full Vedic engine — divisional, dasha, shadbala, panchanga, predictive, KP, muhurta. |\n| `client.apiKeys`         | `/v1/api-keys`                                | Issue / list / revoke your own tokens.                                               |\n| `client.plans`           | `/v1/plans`, `/v1/tenant/plan`                | Catalogue + tenant plan.                                                             |\n| `client.usage`           | `/v1/api-keys/{id}/usage`, `/v1/tenant/usage` | Hourly API-call buckets.                                                             |\n| `client.health`          | `/healthz`, `/readyz`, `/version`             | Liveness / readiness / build info.                                                   |\n| `client.request(...)`    | any                                           | Escape hatch for endpoints not yet wrapped.                                          |\n\n## Quickstart\n\n```ts\nimport { Astrolinkers, InterpretationTier, Language } from \"@astrolinkers/sdk-ts\";\n\nconst client = new Astrolinkers({ apiKey: process.env.ASTROLINKERS_API_KEY! });\n\n// 1. Compute a natal chart.\nconst chart = await client.charts.create({\n  moment: new Date(\"1990-04-15T02:00:00Z\"),\n  latitude: 28.6139,\n  longitude: 77.209,\n  timezone: \"Asia/Kolkata\",\n  locationName: \"New Delhi, India\",\n});\n\n// 2. Per-life-area interpretation.\nconst career = await client.llm.theme({\n  chartId: chart.id,\n  theme: \"career\",\n  language: Language.EN,\n  tier: InterpretationTier.STANDARD,\n});\nconsole.log(career.content);\n\n// 3. Full-chart reading at premium depth, in Hindi.\nconst reading = await client.llm.chartReading({\n  chartId: chart.id,\n  language: Language.HI,\n  tier: InterpretationTier.PREMIUM,\n});\nconsole.log(reading.costUsd, reading.cached);\n```\n\n## Streaming\n\n```ts\nimport { Astrolinkers } from \"@astrolinkers/sdk-ts\";\n\nconst client = new Astrolinkers({ apiKey: \"alk_live_…\" });\n\nfor await (const event of client.llm.chartReadingStream({\n  chartId: chart.id,\n  tier: \"standard\",\n})) {\n  switch (event.kind) {\n    case \"meta\":\n      renderEngineBlocks(event.engine_context);\n      break;\n    case \"delta\":\n      appendText(event.content);\n      break;\n    case \"done\":\n      showCost(event.cost_usd, event.cached);\n      break;\n    case \"error\":\n      showError(event.error ?? \"stream failed\");\n      break;\n  }\n}\n```\n\n## Re-reading past LLM interpretations\n\nEvery successful LLM call is persisted server-side; the SDK exposes\n`listStored` / `retrieveStored` on `client.llm`:\n\n```ts\nconst page = await client.llm.listStored({ chartId: chart.id, limit: 20 });\nfor (const row of page.items) {\n  console.log(row.id, row.interpretation_type, row.cost_usd, row.created_at);\n}\n\nconst row = await client.llm.retrieveStored(page.items[0]!.id);\nconsole.log(row.content);\n```\n\n## Usage analytics\n\n```ts\nimport { UsageGroupBy } from \"@astrolinkers/sdk-ts\";\n\nconst today = new Date();\nconst monthAgo = new Date(today.getTime() - 30 * 24 * 60 * 60 * 1000);\n\nconst summary = await client.llm.usageSummary({\n  from: monthAgo,\n  to: today,\n  groupBy: UsageGroupBy.TIER,\n});\nconsole.log(`30-day LLM spend: $${summary.total.cost_usd.toFixed(4)}`);\nfor (const bucket of summary.breakdown) {\n  console.log(`  ${bucket.label}: ${bucket.call_count} calls, $${bucket.cost_usd.toFixed(4)}`);\n}\n```\n\n## Vedic engine\n\n```ts\nimport { Varga, TheoArea, HouseSignificator } from \"@astrolinkers/sdk-ts\";\n\n// Divisional chart D9 (navamsa).\nconst d9 = await client.vedic.divisional(chart.id, Varga.D9);\n\n// Composite per-planet strength.\nconst strengths = await client.vedic.compositeStrength(chart.id);\n\n// Date-bound career probability folding in current transit modifier.\nconst prob = await client.vedic.materializationAt(chart.id, TheoArea.CAREER, {\n  at: new Date(),\n});\n\n// Full theme probability decomposition.\nconst career = await client.vedic.probability(chart.id, HouseSignificator.CAREER);\n```\n\nEvery Vedic method returns `Record<string, unknown>` — the engine\noutput is deeply structured JSON that is more naturally indexed\nthan matched against a typed model. A runtime `ensureDict` guard\nguarantees the response IS an object.\n\n## Error handling\n\n```ts\nimport {\n  RateLimitedError,\n  AuthenticationError,\n  BudgetExceededError,\n  NotFoundError,\n  ServerError,\n} from \"@astrolinkers/sdk-ts\";\n\ntry {\n  const reading = await client.llm.chartReading({ chartId: \"bogus\", tier: \"premium\" });\n} catch (err) {\n  if (err instanceof NotFoundError) /* … */ ;\n  else if (err instanceof RateLimitedError) {\n    console.log(`Slow down for ${err.retryAfterSeconds}s`);\n  } else if (err instanceof BudgetExceededError) {\n    console.log(`Budget hit: $${err.spentUsd} of $${err.capUsd}`);\n  } else if (err instanceof AuthenticationError) /* … */ ;\n  else if (err instanceof ServerError) /* … */ ;\n  else throw err;\n}\n```\n\n## Escape hatch\n\nFor any endpoint the SDK does not yet wrap, the typed client still\ngives you authenticated requests with the same retry / error-mapping\nbehaviour:\n\n```ts\nconst data = await client.request<{ items: unknown[] }>(\"GET\", \"/v1/some-new-endpoint\", {\n  params: { x: 1 },\n});\n\nconst response = await client.stream(\"POST\", \"/v1/some-stream\");\nfor await (const chunk of response.body!) {\n  // …\n}\n```\n\n## Configuration\n\n| Option            | Default                        | Notes                                                   |\n| ----------------- | ------------------------------ | ------------------------------------------------------- |\n| `apiKey`          | —                              | Required. Bearer token issued by Astrolinkers.          |\n| `baseUrl`         | `https://api.astrolinkers.com` | Override for staging / self-hosted.                     |\n| `timeoutMs`       | `60_000`                       | Connect / write timeout.                                |\n| `readTimeoutMs`   | `300_000`                      | Long for premium streams. `null` disables.              |\n| `maxRetries`      | `2`                            | Transient 5xx / connection. 429 honours `Retry-After`.  |\n| `userAgentSuffix` | —                              | Appended to `User-Agent` for server-side correlation.   |\n| `fetch`           | global `fetch`                 | Inject a custom impl (tests, edge runtimes, telemetry). |\n\n## Versioning\n\nSemantic versioning. Until `1.0` minor releases may carry breaking\nchanges; pin your minor (`\"@astrolinkers/sdk-ts\": \"~0.1\"`) and bump\ndeliberately.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","readmeFilename":"README.md"}