{"id":23501542,"url":"https://github.com/brenekh/go-traktdeviceauth","last_synced_at":"2025-04-28T10:58:09.441Z","repository":{"id":57648948,"uuid":"445391540","full_name":"BrenekH/go-traktdeviceauth","owner":"BrenekH","description":"A Go library to allow an end user to authorize a third-party Trakt application access to their account using the device method.","archived":false,"fork":false,"pushed_at":"2022-10-10T19:39:56.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T16:38:39.834Z","etag":null,"topics":["auth","authentication","device-authentication","go","go-library","golang","golang-library","trakt","trakt-api","trakt-tv","trakttv"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/BrenekH/go-traktdeviceauth","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrenekH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-07T03:57:00.000Z","updated_at":"2023-09-28T19:55:20.000Z","dependencies_parsed_at":"2023-01-19T18:01:54.471Z","dependency_job_id":null,"html_url":"https://github.com/BrenekH/go-traktdeviceauth","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrenekH%2Fgo-traktdeviceauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrenekH%2Fgo-traktdeviceauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrenekH%2Fgo-traktdeviceauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrenekH%2Fgo-traktdeviceauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrenekH","download_url":"https://codeload.github.com/BrenekH/go-traktdeviceauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251302395,"owners_count":21567589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth","authentication","device-authentication","go","go-library","golang","golang-library","trakt","trakt-api","trakt-tv","trakttv"],"created_at":"2024-12-25T07:18:25.962Z","updated_at":"2025-04-28T10:58:09.417Z","avatar_url":"https://github.com/BrenekH.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Trakt Device Auth Library\n\n[![GoDoc](https://pkg.go.dev/badge/github.com/BrenekH/go-traktdeviceauth)](https://pkg.go.dev/github.com/BrenekH/go-traktdeviceauth)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/BrenekH/go-traktdeviceauth?label=version)\n[![License](https://img.shields.io/github/license/BrenekH/go-traktdeviceauth)](https://github.com/BrenekH/go-traktdeviceauth/tree/master/LICENSE)\n![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/BrenekH/go-traktdeviceauth)\n\nA Go library to allow an end user to authorize a third-party Trakt application access to their account using the [device method](https://trakt.docs.apiary.io/#reference/authentication-devices/generate-new-device-codes).\n\n## Conventions\n\n### Client ID and Client Secret\n\nThroughout the library, the Client ID and Client Secret are used to tell Trakt which app is requesting access.\nThese values are found in the [dashboard for the app on Trakt's website](https://trakt.tv/oauth/applications), as shown in the image below.\n\n![Client ID and Client Secret on the Trakt Application Dashboard](/images/client-id-secret-dashboard.png)\n\n### Context Functions\n\nMany functions in this library have context counterparts which allow a custom [context.Context](https://pkg.go.dev/context#Context) to be used.\nIf you don't know what all this means, you'll probably be fine sticking with the non-context versions.\n\n## Installation\n\nAs a Go library: `go get -u github.com/BrenekH/go-traktdeviceauth`\n\nAs an executable: `go install github.com/BrenekH/go-traktdeviceauth/cmd@latest`\nor download from the [latest release](https://github.com/BrenekH/go-traktdeviceauth/releases/latest).\n\n## Usage\n\nAs suggested by the [official API docs](https://trakt.docs.apiary.io/#reference/authentication-devices/generate-new-device-codes), a device and user code pair must be generated as the first step using [GenerateNewCode](https://pkg.go.dev/github.com/BrenekH/go-traktdeviceauth#GenerateNewCode).\nNext, the user needs to directed to the returned verification url and instructed to enter the user code into the website.\nFinally, [PollForAuthToken](https://pkg.go.dev/github.com/BrenekH/go-traktdeviceauth#GenerateNewCode) is used to wait for the user to complete authentication or the code to expire.\n\nIf the returned access token expires, a new one can be generated with asking the user to re-authenticate by using [RefreshAccessToken](https://pkg.go.dev/github.com/BrenekH/go-traktdeviceauth#RefreshAccessToken)\n\nTrakt recommends that the `AccessToken` and `RefreshToken` be saved in permanent storage so that the user doesn't need to log in every time your program starts.\n\n## License\n\nThis project is licensed under the Apache 2.0 license, a copy of which can be found in [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrenekh%2Fgo-traktdeviceauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrenekh%2Fgo-traktdeviceauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrenekh%2Fgo-traktdeviceauth/lists"}