{"id":17254318,"url":"https://github.com/nwunderly/starlette-discord","last_synced_at":"2025-03-16T13:09:10.303Z","repository":{"id":37828968,"uuid":"328291560","full_name":"nwunderly/starlette-discord","owner":"nwunderly","description":"\"Login with Discord\" support for Starlette and FastAPI","archived":false,"fork":false,"pushed_at":"2024-09-10T00:25:57.000Z","size":106,"stargazers_count":31,"open_issues_count":5,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-09T13:33:01.573Z","etag":null,"topics":["discord-api","discord-oauth2-extension","fastapi","login-with-discord","oauth2","starlette","starlette-discord"],"latest_commit_sha":null,"homepage":"https://starlette-discord.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwunderly.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-10T02:59:14.000Z","updated_at":"2025-03-04T12:16:54.000Z","dependencies_parsed_at":"2024-10-31T08:03:05.866Z","dependency_job_id":"20bb3cb7-f95e-43ff-8d71-8c77c55e0aac","html_url":"https://github.com/nwunderly/starlette-discord","commit_stats":{"total_commits":57,"total_committers":5,"mean_commits":11.4,"dds":0.3157894736842105,"last_synced_commit":"78014241f64383633d1b3f1553198d0021419ebc"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwunderly%2Fstarlette-discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwunderly%2Fstarlette-discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwunderly%2Fstarlette-discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwunderly%2Fstarlette-discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwunderly","download_url":"https://codeload.github.com/nwunderly/starlette-discord/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871903,"owners_count":20361380,"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":["discord-api","discord-oauth2-extension","fastapi","login-with-discord","oauth2","starlette","starlette-discord"],"created_at":"2024-10-15T07:08:21.578Z","updated_at":"2025-03-16T13:09:10.277Z","avatar_url":"https://github.com/nwunderly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Starlette-Discord\n \"Login with Discord\" support for Starlette and FastAPI\n\nstarlette-discord is a Discord OAuth2 module intended for use with Starlette and FastAPI.\n\n\n#### Installing\n\nstarlette-discord can be installed with the command\n\n```sh\n# Linux\npython3 -m pip install -U starlette-discord\n\n# Windows\npython -m pip install -U starlette-discord\n```\n\nTo install the development version of the library directly from source:\n\n```sh\n$ git clone https://github.com/nwunderly/starlette-discord\n$ cd starlette-discord\n$ python3 -m pip install -U .\n```\n\n### Quickstart\n\nBelow is an example FastAPI app implementing Discord's OAuth flow to identify the user.\n\n```py\nimport uvicorn\nfrom fastapi import FastAPI\nfrom starlette_discord import DiscordOAuthClient\n\nclient_id = \"YOUR APP'S CLIENT ID HERE\"\nclient_secret = \"YOUR APP'S CLIENT SECRET HERE\"\nredirect_uri = \"http://localhost:8000/callback\"\n\napp = FastAPI()\ndiscord_client = DiscordOAuthClient(client_id, client_secret, redirect_uri)\n\n@app.get('/login')\nasync def start_login():\n    return discord_client.redirect()\n\n@app.get('/callback')\nasync def finish_login(code: str):\n    user = await discord_client.login(code)\n    print(user)\n    return user\n\nuvicorn.run(app)\n```\n\nTo begin the OAuth authorization flow with this app, visit `http://localhost:8000/login`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwunderly%2Fstarlette-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwunderly%2Fstarlette-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwunderly%2Fstarlette-discord/lists"}