A Trakt.tv client with native Typescript support and quality of life features
- ๐ต Browser & Node.js support
- ๐ No auth lock-in
- ๐ฅ Able to handle > 1 user 1
- ๐ฒ Tree Shakable
- ๐ Trakt specific http errors
- ๐๏ธ Built with TypeScript
# npm
npm install better-trakt
# Yarn
yarn add better-trakt
# pnpm
pnpm add better-trakt
import { Trakt } from 'better-trakt';
const client = new Trakt({
clientId: 'client id',
clientSecret: 'client secret',
});
// get every movie a user has watched
const watchedMovies = await client.users.watchedMovies({ userId: '1234', accessToken: 'abcd123' });
// get the summary for the show with the trakt id of "1"
const show1 = await client.shows.summary('1');
More examples in the examples folder.
โ : Full Support | ๐ง: Partial Support | โ: No Support
Runtime | Supported |
---|---|
Node.js | โ |
Browser | โ 2 |
(All namespaces are planned, this is just what's currently supported.)
Namespace | Supported |
---|---|
Authentication - OAuth | โ |
Authentication - Devices | โ |
Calendars | โ |
Checkin | โ |
Certifications | โ |
Comments | โ |
Countries | โ |
Genres | โ |
Languages | โ |
Lists | โ |
Movies | โ |
Networks | โ |
People | โ |
Recommendations | โ |
Scrobble | โ |
Search | โ |
Shows | โ |
Seasons | โ |
Episodes | โ |
Sync | โ |
Users | ๐ง |
Docs for the latest release can be found at https://getaugur.github.io/better-trakt/. For a more complete understanding of the api in general please visit https://trakt.docs.apiary.io/.
As described in the offical docs, you need to use 3rd party APIs. Listed below are some libraries we recommend using, all of which have typescript support:
- moviedb-promise
- omdb (has some issues)
Until beter-trakt
reaches 1.0
, there may be breaking changes in new minor versions.
Footnotes
-
This really shouldn't need be a "feature," but all the other SDKs can only handle 1 user at a time so it is. โฉ
-
See Axios's supported browsers, might also require a transpiler like babel, esbuild, etc. โฉ