{"id":15486012,"url":"https://github.com/khrj/slack-oauth","last_synced_at":"2026-04-24T07:34:22.429Z","repository":{"id":51170946,"uuid":"337762310","full_name":"khrj/slack-oauth","owner":"khrj","description":"Setup the OAuth flow for Slack apps easily. Deno port of @slack/oauth","archived":false,"fork":false,"pushed_at":"2021-07-12T13:36:08.000Z","size":82,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T11:14:00.609Z","etag":null,"topics":["deno","oauth","slack","slack-api"],"latest_commit_sha":null,"homepage":"https://deno.land/x/slack_oauth","language":"TypeScript","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/khrj.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":"2021-02-10T15:13:56.000Z","updated_at":"2021-10-04T14:51:56.000Z","dependencies_parsed_at":"2022-09-08T06:20:34.401Z","dependency_job_id":null,"html_url":"https://github.com/khrj/slack-oauth","commit_stats":null,"previous_names":["khushrajrathod/slack-oauth"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/khrj/slack-oauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fslack-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fslack-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fslack-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fslack-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khrj","download_url":"https://codeload.github.com/khrj/slack-oauth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khrj%2Fslack-oauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32214417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deno","oauth","slack","slack-api"],"created_at":"2024-10-02T06:05:41.885Z","updated_at":"2026-04-24T07:34:22.411Z","avatar_url":"https://github.com/khrj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"assets/logo.svg\" width=\"400\" height=\"400\" alt=\"slack_oauth illustration\"\u003e\n    \u003ch1\u003eSlack Oauth\u003c/h1\u003e\n    \u003cp\u003e\n        \u003cb\u003eSetup the OAuth flow for Slack apps easily. Deno port of \u003ca href=\"https://www.npmjs.com/package/@slack/oauth\"\u003e@slack/oauth\u003c/a\u003e\u003c/b\u003e\n    \u003c/p\u003e\n    \u003cp\u003e\n        \u003cimg alt=\"build status\" src=\"https://img.shields.io/github/workflow/status/khrj/slack-oauth/Deno?label=checks\" \u003e\n        \u003cimg alt=\"language\" src=\"https://img.shields.io/github/languages/top/khrj/slack-oauth\" \u003e\n        \u003cimg alt=\"code size\" src=\"https://img.shields.io/github/languages/code-size/khrj/slack-oauth\"\u003e\n        \u003cimg alt=\"issues\" src=\"https://img.shields.io/github/issues/khrj/slack-oauth\" \u003e\n        \u003cimg alt=\"license\" src=\"https://img.shields.io/github/license/khrj/slack-oauth\"\u003e\n        \u003cimg alt=\"version\" src=\"https://img.shields.io/github/v/release/khrj/slack-oauth\"\u003e\n    \u003c/p\u003e\n    \u003cp\u003e\n        \u003cb\u003e\u003ca href=\"https://deno.land/x/slack_oauth\"\u003eView on deno.land\u003c/a\u003e\u003c/b\u003e\n    \u003c/p\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n    \u003cbr\u003e\n\u003c/div\u003e\n\n### Note on Compatiblity\n\nThis is module is mostly compatible with its [node\ncounterpart](https://www.npmjs.com/package/@slack/oauth). However,\n`InstallProvider` does not contain a `handleCallback` function taking request\nand response handlers. Instead, it has a `handle` function which takes a `code`\nand a `state` and does not handle responding and returns a promise which\nresolves / rejects to the default HTML for successes / errors, which you can\nthen respond with or override. This is to maximize compatiblity with various\nDeno HTTP servers.\n\n## Usage\n\n### Handling requests\n\nThe following is an example of handling a request using [Oak](https://github.com/oakserver/oak) as the HTTP server\n\n```ts\nimport \"https://deno.land/x/dotenv@v2.0.0/load.ts\"\n\nimport { nanoid } from \"https://deno.land/x/nanoid@v3.0.1/mod.ts\"\nimport { Application, Router } from \"https://deno.land/x/oak/mod.ts\"\nimport { InstallProvider } from \"https://deno.land/x/slack_oauth@3.0.2/mod.ts\"\n\n// initialize the installProvider\nconst installer = new InstallProvider({\n    clientId: Deno.env.get(\"SLACK_CLIENT_ID\")!,\n    clientSecret: Deno.env.get(\"SLACK_CLIENT_SECRET\")!,\n    stateSecret: nanoid(),\n})\n\nconst router = new Router()\nrouter.get(\"/\", async (ctx) =\u003e {\n    ctx.response.redirect(\n        await installer.generateInstallUrl({\n            scopes: [\"chat:write\"],\n        }),\n    )\n})\n\nrouter.get(\"/slack/oauth_redirect\", async (ctx) =\u003e {\n    const code = ctx.request.url.searchParams.get(\"code\")\n    const state = ctx.request.url.searchParams.get(\"state\")\n\n    if (!code || !state) {\n        ctx.response.status = 401\n        ctx.response.body = \"Unauthorized - Missing code or state\"\n        return\n    }\n\n    try {\n        const successMessage = await installer.handle(code, state)\n        ctx.response.status = 200\n        ctx.response.body = successMessage\n    } catch (e) {\n        ctx.response.status = 500\n        ctx.response.body = e.message\n    }\n})\n\nconst app = new Application()\napp.use(router.routes())\napp.use(router.allowedMethods())\nawait app.listen({ port: 8000 })\n```\n\n### Authorization\n\nYou can use the the `installer.authorize()` function to fetch data that has been saved in your installation store.\n\n```ts\nimport { InstallProvider } from \"https://deno.land/x/slack_oauth@3.0.2/mod.ts\"\nconst installer = new InstallProvider({\n    clientId: Deno.env.get(\"SLACK_CLIENT_ID\")!,\n    clientSecret: Deno.env.get(\"SLACK_CLIENT_SECRET\")!,\n    stateSecret: nanoid(),\n})\n\nconst result = await installer.authorize({ teamId: \"my-team-ID\" })\n\nconsole.log(result)\n```\n\n## API\n\n- Methods are almost identical to the [node @slack/oauth](https://www.npmjs.com/package/@slack/oauth) (see [Note on Compatiblity](#note-on-compatiblity))\n- Generated docs are available at https://doc.deno.land/https/deno.land/x/slack_oauth@3.0.2/mod.ts\n\n## Supporters\n\n[![Stargazers repo roster for @khrj/slack-oauth](https://reporoster.com/stars/khrj/slack-oauth)](https://github.com/khrj/slack-oauth/stargazers)\n\n[![Forkers repo roster for @khrj/slack-oauth](https://reporoster.com/forks/khrj/slack-oauth)](https://github.com/khrj/slack-oauth/network/members)\n\n## Related\n\n- [Deno Slack SDK](https://github.com/slack-deno/deno-slack-sdk)\n- [Deno modules](https://github.com/khrj/deno-modules)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhrj%2Fslack-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhrj%2Fslack-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhrj%2Fslack-oauth/lists"}