[BUG] Missing Type Definition in Official TS SDK
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.21
- Operating System: macOS 15.5
- Terminal: zsh
Bug Description
The Typescript SDK: @anthropic-ai/claude-code does not export types
Steps to Reproduce
Try to use:
import { query, type SDKMessage } from '@anthropic-ai/claude-code';
Expected Behavior
No errors
Actual Behavior
Typescript is unable to resolve the correct type and errors with:
Could not find a declaration file for module '@anthropic-ai/claude-code'. '/Users/brian/gt/gt-libraries/node_modules/@anthropic-ai/claude-code/sdk.mjs' implicitly has an 'any' type.
Additional Context
Adding "types": "sdk.d.ts", to the package.json fixes the issue
Fix incoming!
I think this is now working but I'm noticing references to the SDK are not resolving properly, meaning Message is typed as any
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Hey this is still an issue. Any updates on this?
Ok for whoever comes here, u need to now use the lib @anthropic-ai/claude-agent-sdk. They have renamed it. Install this one and you are good to go 😄
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.