https://github.com/getaugur/better-trakt
A Trakt.tv client with native Typescript support and quality of life features
https://github.com/getaugur/better-trakt
javascript nodejs sdk trakt trakt-api trakt-tv typescript
Last synced: 7 months ago
JSON representation
A Trakt.tv client with native Typescript support and quality of life features
- Host: GitHub
- URL: https://github.com/getaugur/better-trakt
- Owner: getaugur
- License: mit
- Created: 2022-08-04T18:36:56.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-29T16:26:27.000Z (about 2 years ago)
- Last Synced: 2025-03-18T01:43:00.434Z (7 months ago)
- Topics: javascript, nodejs, sdk, trakt, trakt-api, trakt-tv, typescript
- Language: TypeScript
- Homepage: https://getaugur.github.io/better-trakt/
- Size: 1.47 MB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Better Trakt
[](https://github.com/getaugur/better-trakt/blob/main/LICENSE) [](https://www.npmjs.com/package/better-trakt)
> A Trakt.tv client with native Typescript support and quality of life features
## Features
- 🖵 Browser & Node.js support
- 🔒 No auth lock-in
- 👥 Able to handle > 1 user [^1]
- 🌲 Tree Shakable
- 🌐 Trakt specific http errors
- 🏗️ Built with TypeScript[^1]: This really shouldn't need be a "feature," but all the other SDKs can only handle 1 user at a time so it is.
## Install
```bash
# npm
npm install better-trakt# Yarn
yarn add better-trakt# pnpm
pnpm add better-trakt
```## Usage
```js
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](https://github.com/getaugur/better-trakt/tree/main/example)._
## Compatibility
✅: Full Support | 🚧: Partial Support | ❌: No Support
### Runtimes
| Runtime | Supported |
| ------- | :-------: |
| Node.js | ✅ |
| Browser | ✅[^2] |[^2]: See [Axios's supported browsers](https://github.com/axios/axios/#browser-support), _might_ also require a transpiler like [babel](https://babeljs.io/), [esbuild](https://esbuild.github.io/), etc.
### Trakt Api
(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
Docs for the latest release can be found at [https://getaugur.github.io/better-trakt/](https://getaugur.github.io/better-trakt/). For a more complete understanding of the api in general please visit [https://trakt.docs.apiary.io/](https://trakt.docs.apiary.io/).
## Getting Images
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](https://github.com/grantholle/moviedb-promise)
- [omdb](https://github.com/thblt-thlgn/omdb) (has some issues)## ⚠️ Alpha Notice
Until `beter-trakt` reaches `1.0`, there may be breaking changes in new minor versions.