vankasteelj/trakt.tv — reverse-engineered prompt
Reverse engineered prompt
Build me a Node.js library that makes the Trakt.tv API easy to use from JavaScript. I want someone to be able to add their Trakt client id and secret, create a Trakt object, authenticate with the normal OAuth flow or the device code flow, then call Trakt methods like searching movies, getting calendars, popular movies, and user related requests without manually building URLs.
Please include token handling so the library can exchange codes, refresh tokens, export and import stored tokens between sessions, and revoke access. Make requests return promises and include helpful errors. Add optional debug logging, optional pagination info from response headers, and a simple way to load extra plugins so people can extend it later.
Use the Trakt API v2 docs as the source of truth and look up current docs online if you need to. Include a clear README with install, setup, authentication, example API calls, pagination, and plugin usage.
Want more depth? Deep Reverse