{"id":13571295,"url":"https://github.com/emedvedev/slackin-extended","last_synced_at":"2025-04-12T15:43:23.971Z","repository":{"id":26414698,"uuid":"89486250","full_name":"emedvedev/slackin-extended","owner":"emedvedev","description":"Public Slack organizations made easy (extended fork of rauchg/slackin)","archived":false,"fork":false,"pushed_at":"2023-07-18T20:15:00.000Z","size":3264,"stargazers_count":162,"open_issues_count":31,"forks_count":89,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T16:12:46.339Z","etag":null,"topics":["slack","slackin"],"latest_commit_sha":null,"homepage":"https://slackin-extended.emedvedev.now.sh","language":"JavaScript","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/emedvedev.png","metadata":{"files":{"readme":"readme.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"license.md","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":"2017-04-26T13:49:55.000Z","updated_at":"2024-11-24T16:43:14.000Z","dependencies_parsed_at":"2024-06-21T16:43:08.894Z","dependency_job_id":"155c5069-49b6-4e86-986f-07b7760fd2d6","html_url":"https://github.com/emedvedev/slackin-extended","commit_stats":{"total_commits":595,"total_committers":77,"mean_commits":"7.7272727272727275","dds":0.7630252100840336,"last_synced_commit":"3632bc2f493fe97dcdffd9dfffb48022c92f3b40"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emedvedev%2Fslackin-extended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emedvedev%2Fslackin-extended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emedvedev%2Fslackin-extended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emedvedev%2Fslackin-extended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emedvedev","download_url":"https://codeload.github.com/emedvedev/slackin-extended/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590939,"owners_count":21129916,"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":["slack","slackin"],"created_at":"2024-08-01T14:01:00.708Z","updated_at":"2025-04-12T15:43:23.948Z","avatar_url":"https://github.com/emedvedev.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/slackin-extended?logo=npm\u0026logoColor=fff)](https://www.npmjs.com/package/slackin-extended) [![Build Status](https://img.shields.io/github/actions/workflow/status/emedvedev/slackin-extended/test.yml?branch=master\u0026label=Tests\u0026logo=github)](https://github.com/emedvedev/slackin-extended/actions/workflows/test.yml?query=branch%3Amaster) [![MIT License](https://img.shields.io/github/license/emedvedev/slackin-extended)](https://github.com/emedvedev/slackin-extended/blob/master/license.md)\n\n## Features\n\nSlackin-extended is a more customizable and extendable fork of the original [slackin](https://github.com/rauchg/slackin).\n\n- A landing page you can point users to fill in their emails and receive an invite (`https://slack.yourdomain.com`)\n- An `\u003ciframe\u003e` badge to embed on any website that shows connected users in *realtime* with socket.io.\n- A SVG badge that works well from static mediums (like GitHub README pages)\n- Abuse prevention via [Google reCAPTCHA](https://www.google.com/recaptcha/intro/), including Invisible reCAPTCHA.\n- Color scheme customization on both the landing page and the badge.\n\nCheck out the [Demo](https://slackin-extended.now.sh/), which is deployed live from the `master` branch. For the list of changes in `slackin-extended` see [HISTORY.md](HISTORY.md).\n\n**Disclaimer:** this project is not affiliated with Slack. The Slack logo and Slack API are copyright Slack Technologies, Inc.\n\n## Installation\n\n### Heroku\n\n[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)\n\n### Now\n\nSet up [Now](https://zeit.co/now) on your device and run it! If you don't have an `.env` file for your Now deployment (see [environment variables and secrets](https://zeit.co/docs/v2/environment-variables-and-secrets#accessing-environment-variables)), you can just set the two required parameters through `now secrets`:\n\n```bash\ngit clone https://github.com/emedvedev/slackin-extended.git\nnow secrets add slack-subdomain \"myslack\"\nnow secrets add slack-api-token \"xoxb-YOUR-SLACK-TOKEN\"\nnow slackin-extended\n```\n\n### Fly.io\n\nSet up [Fly.io](https://fly.io/) to run slackin-extended. You'll need to set a specific port to play well with the default fly port config.\n\n```bash\ngit clone https://github.com/emedvedev/slackin-extended.git\nflyctl secrets set SLACK_SUBDOMAIN=\"myslack\" SLACK_API_TOKEN=\"xoxb-YOUR-SLACK-TOKEN\" SLACKIN_PORT=8080\nflyctl deploy\n```\n\n### Docker\n\nThe Docker container is available on Docker Hub: [emedvedev/slackin-extended](https://hub.docker.com/r/emedvedev/slackin-extended/).\n\n### npm\n\nTo host Slackin-extended yourself, install it via `npm` and launch it on your server:\n\n```bash\nnpm install -g slackin-extended\nslackin \"workspace-id\" \"your-slack-token\"\n```\n\n## Usage\n\n### Badges\n\n#### Realtime ([demo](https://cldup.com/IaiPnDEAA6.gif))\n\n```html\n\u003cscript async defer src=\"https://slack.yourdomain.com/slackin.js\"\u003e\u003c/script\u003e\n\u003c!-- append \"?large\" to the URL for the large version --\u003e\n```\n\n#### SVG ([demo](https://cldup.com/jWUT4QFLnq.png))\n\n```html\n\u003cimg src=\"https://slack.yourdomain.com/badge.svg\"\u003e\n```\n\nBy default, the badge background color will be set to your accent color, but you can customize both background and text colors through the query string:\n\n```html\n\u003cimg src=\"https://slack.yourdomain.com/badge.svg?bg=e01563\u0026fg=ffffff\"\u003e\n```\n\n### Parameters\n\nEvery CLI parameter, including mandatory arguments (workspace ID and token), can alternatively be configured through environment variables.\n\n| Flag | Short | Environment variable | Default | Description |\n| --- | --- | --- | --- | --- |\n| Positional 1 | — | `SLACK_SUBDOMAIN` | **Required** | Slack workspace ID (`https://**{this}**.slack.com`) |\n| Positional 2 | — | `SLACK_API_TOKEN` | **Required** | [API token](https://get.slack.help/hc/en-us/articles/215770388-Creating-and-regenerating-API-tokens) |\n| --port | -p | `SLACKIN_PORT` | `3000` | Port to listen on |\n| --hostname | -h | `SLACKIN_HOSTNAME` | `'0.0.0.0'` | Hostname to listen on |\n| --channels | -c | `SLACKIN_CHANNELS` | `''` | One or more comma-separated channel names to allow single-channel guests |\n| --emails | -e | `SLACKIN_EMAILS` | `''` | Restrict sign-up to a list of emails (comma-separated; wildcards are supported) |\n| --interval | -i | `SLACKIN_INTERVAL` | `60000` | How frequently (ms) to poll Slack |\n| --path | -P | `SLACKIN_PATH` | `/` | Path to serve slackin under |\n| --silent | -s | `SLACKIN_SILENT` | `false` | Do not print out warnings or errors |\n| --cors | -x | `SLACKIN_CORS` | `false` | Enable CORS for all routes |\n| --analytics | -a | `SLACKIN_ANALYTICS` | `''` | Google Analytics ID |\n| --recaptcha-secret | -R | `RECAPTCHA_SECRET` | `''` | reCAPTCHA secret |\n| --recaptcha-sitekey | -K | `RECAPTCHA_SITEKEY` | `''` | reCAPTCHA sitekey |\n| --recaptcha-invisible | -I | `RECAPTCHA_INVISIBLE` | `''` | Use [invisible reCAPTCHA](https://developers.google.com/recaptcha/docs/invisible) |\n| --theme | -T | `SLACKIN_THEME` | `light` | Color scheme to use, `light` or `dark` |\n| --accent | -A | `SLACKIN_ACCENT` | `#e01563` for `light`, `#9a0e44` for `dark` | Accent color to use instead of a theme default |\n| --coc | -C | `SLACKIN_COC` | `''` | Full URL to a CoC that needs to be agreed to |\n| --css | -S | `SLACKIN_CSS` | `''` | Full URL to a custom CSS file to use on the main page |\n| | | `SLACKIN_PAGE_DELAY` | `0` | Delay (ms) between Slack API requests (may be required for large workspaces that hit the rate limit) |\n| | | `SLACKIN_PROXY` | `false` | Trust proxy headers (only use if Slackin is served behind a reverse proxy) |\n| | | `SLACKIN_HTTPS_REDIRECT` | `''` | If a domain name is specified in this parameter and `SLACKIN_PROXY` is set to `true`, Slackin will redirect requests with `x-forwarded-proto === 'http'` to `https://\u003cSLACKIN_HTTPS_REDIRECT\u003e/\u003coriginal URL\u003e` |\n| | | `SLACKIN_LETSENCRYPT` | `''` | [Let's Encrypt](https://letsencrypt.org/) challenge response |\n\nAlternatively, you can specify the configuration parameters in a [dotenv file](https://github.com/motdotla/dotenv): create a `.env` file in the root directory of your project and add environment-specific variables on new lines in the form of NAME=VALUE. For example:\n\n```\nSLACK_SUBDOMAIN=mysubdomain\nSLACK_API_TOKEN=SLACK-API-TOKEN\nSLACKIN_THEME=dark\n```\n\n## Extras\n\n### Tips and tricks\n\n- Please use reCAPTCHA for your Slack to avoid request flooding by spambots. Here is where to [get your secret and\nsitekey](https://www.google.com/recaptcha/admin). Make sure you choose a **v3 API key**.\n\n- [Invisible reCAPTCHA](https://developers.google.com/recaptcha/docs/invisible) is recommended for the realtime badge users, as the regular CAPTCHA challenge is broken inside the iframe that opens on badge click.\n\n- You can find or generate your API test token at [api.slack.com/web](https://api.slack.com/web). **Important notes**:\n  - you need a legacy token\n  - the user you use to generate the token must be an admin. You need to create a dedicated `@slackin-inviter` user (or similar), mark that user an admin, and use a test token from that dedicated admin user.  Note that test tokens have actual permissions so you **do not** need to create an OAuth 2 app. Also check out the Slack docs on [generating a test token](https://get.slack.help/hc/en-us/articles/215770388-Creating-and-regenerating-API-tokens).\n\n- **Important:** If you use Slackin in single-channel mode, you'll only be\nable to invite as many external accounts as paying members you have\ntimes 5. If you are not getting invite emails, this might be the reason.\nWorkaround: sign up for a free org, and set up Slackin to point to it\n(all channels will be visible).\n\n### Development\n\n1. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) this repository to your own GitHub account and then [clone](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) it to your local device\n2. Uninstall slackin if it's already installed: `npm uninstall -g slackin-extended`\n3. Link it to the global module directory: `npm link`\n4. Run it locally with `npm run dev`, after setting up the **needed** [environment variables](#parameters)\n\nYay! Now can use the `slackin` command everywhere.\n\n### Extending templates and themes\n\nIf changing accent colors and switching between light/dark themes isn't enough for you, all templates are stored inside `views/` and can be easily modified. Stylesheets are stored in `scss/`, and both themes have a documented example of colors, variables and additional styles necessary to create your own.\n\nIf you end up creating another theme, you're more than welcome to submit a PR!\n\n### API\n\nLoading `slackin` will return a `Function` that creates a `HTTP.Server` instance:\n\n```js\nconst slackin = require('slackin-extended');\n\nslackin({\n  token: 'SLACK-API-TOKEN', // reqired\n  org: 'your-slack-subdomain', // required\n  interval: 60000, // polling interval for Slack servers\n  path: '/some/path/you/host/slackin/under/', // defaults to '/'\n  cors: false, // set to \"true\" to enable CORS\n  recaptcha: {\n    secret: 'RECAPTCHA-SECRET', // reCAPTCHA secret\n    sitekey: 'RECAPTCHA-SITEKEY', // reCAPTCHA sitekey\n    invisible: true, // enable Invisible reCAPTCHA\n  },\n  analytics: 'GOOGLE-ANALYTICS-ID', // Google Analytics ID\n  theme: 'light', // color scheme: \"light\" or \"dark\"\n  accent: 'teal', // accent color (for buttons, text accents, etc.)\n  css: 'https://example.org/slackin-extra.css', // external CSS file to include\n  channels: 'community-public,testing', // for single-channel mode\n  emails: 'john@gmail.com,jane@gmail.com,*@johnandjane.com', // email whitelist\n  coc: 'https://example.org/code-of-conduct', // code of conduct link\n  proxy: false, // set to \"true\" if Slackin is set up behind a reverse proxy\n  redirectFQDN: 'slack.myorg.com', // redirect requests with x-forwarded-proto === 'http' to this domain\n  letsencrypt: 'LETSENCRYPT-CHALLENGE', // Let's Encrypt challenge\n  silent: false, // suppress warnings\n  server: http.Server(), // optional, allows passing in an existing http server object\n}).listen(3000)\n```\n\nThis will show response times from Slack and how many online users you have on the console. The returned `http.Server` has an `app` property that is the `express` application that you can define or override routes on.\n\nAll the metadata for your organization can be fetched via a JSON HTTP request to `/data`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femedvedev%2Fslackin-extended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femedvedev%2Fslackin-extended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femedvedev%2Fslackin-extended/lists"}