Skip to content

Fix npm package and library export#17

Draft
mjdierkes wants to merge 1 commit intomainfrom
cursor/fix-npm-package-and-library-export-e538
Draft

Fix npm package and library export#17
mjdierkes wants to merge 1 commit intomainfrom
cursor/fix-npm-package-and-library-export-e538

Conversation

@mjdierkes
Copy link
Copy Markdown
Owner

@mjdierkes mjdierkes commented Jul 28, 2025

Enable npm publishing and library usage for cursor-api-client by fixing package exports and lazy-loading configuration.

The package was not publishable to npm and could not be used as a library due to incorrect package.json configurations, a missing main export file, and an eager session token load that prevented library imports without pre-configured credentials. This PR resolves these issues, making the package a proper npm library.


Open in WebOpen in CursorOpen Docs


Summary by cubic

Fixed npm publishing and library usage for cursor-api-client by correcting package exports, adding a main export file, and making session token loading lazy.

  • Refactors

    • Updated package.json exports and entry points for proper library and CLI use.
    • Added src/index.ts to enable clean imports for library consumers.
    • Changed config to load the session token only when needed.
  • Documentation

    • Improved README with clear npm install instructions and library usage examples.

…pport

Co-authored-by: mason <mason@thewrapper.company>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants