# slack-inviter **Repository Path**: cncf/slack-inviter ## Basic Information - **Project Name**: slack-inviter - **Description**: Simple Slack inviter that requires folks to accept the CNCF CoC and review our Slack guidelines. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-23 - **Last Updated**: 2026-07-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Slack Inviter A lightweight, self-service form that invites people to our Slack workspace. Visitors must confirm they've read the **CNCF Code of Conduct** and the **Slack guidelines**, and are then sent to the workspace's shared invite link. - **Front end:** plain HTML/CSS/JS (no framework), served as a static site. - **Back end:** a single Netlify serverless function that gates the invite link. - **Deployment:** Netlify. ## How it works ``` Browser form ──POST /.netlify/functions/invite──► Serverless function ──► Slack shared invite link (two consent checkboxes) (validates consent, holds the invite link) ``` Slack has no official API for inviting external emails into a Free/Pro/Business+ workspace, so this app uses Slack's built-in **shared invite link**. The link is stored as a server-side environment variable and is **never** placed in the page source. The function checks that both consent checkboxes are ticked and only then returns the link, to which the browser is redirected. > **Why not send invites by email via the API?** Programmatic email invites are > only available on **Enterprise Grid** (`admin.users.invite`). On other plans > the supported path is a shared invite link, which is what this app uses. ## Project structure ``` public/ index.html # The consent form styles.css # Styling script.js # Client-side submit handling netlify/functions/ invite.js # Serverless function that gates the invite link netlify.toml # Netlify build & function config .env.example # Template for the required SLACK_INVITE_LINK ``` ## Getting the Slack invite link In Slack, open **Invite people → Share an invite link → Copy link** (a workspace admin may need to enable invite links). Treat the link as a secret, and rotate it if it expires or hits its member cap. ## Local development 1. Install dependencies: ```bash npm install ``` 2. Copy the env template and add your invite link: ```bash cp .env.example .env # edit .env and set SLACK_INVITE_LINK ``` 3. Run the local dev server (serves the static site and the function): ```bash npm run dev ``` Open the URL Netlify prints (usually http://localhost:8888). ## Deploying to Netlify ### One-time setup 1. Push this repo to GitHub/GitLab. 2. In the [Netlify dashboard](https://app.netlify.com), **Add new site → Import an existing project**, and select the repo. The settings in `netlify.toml` (publish dir `public`, functions dir `netlify/functions`) are picked up automatically. 3. Under **Site settings → Environment variables**, add: - `SLACK_INVITE_LINK` = your Slack shared invite link. 4. Trigger a deploy. ### CLI deploy (alternative) ```bash npm install npx netlify login npx netlify link # link to your Netlify site npx netlify env:set SLACK_INVITE_LINK "https://join.slack.com/t/..." npm run deploy # deploys to production ``` ## Security notes - The invite link is only ever read on the server via `process.env.SLACK_INVITE_LINK` and is returned only after both consent checkboxes pass server-side validation. - **Bot/spam protection is not yet enabled.** An open invite form is a common spam target. Before going public, consider adding rate limiting and a CAPTCHA (e.g. Cloudflare Turnstile) to the serverless function. ## Customization - The UI follows the [CNCF brand guidelines](https://www.cncf.io/brand-guidelines/) (CNCF Blue `#0086FF`, Clarity City typeface, official logo). Palette and fonts live in [public/styles.css](public/styles.css); the logo is referenced in [public/index.html](public/index.html). - Assets are self-contained: the CNCF logo and the [Clarity City](https://github.com/vmware/clarity-city) webfonts (MIT-licensed) are vendored under `public/assets/`, so the app has no external asset dependencies at runtime. - Update the guideline links in [public/index.html](public/index.html) if the CNCF CoC or Slack guideline URLs change. - Adjust styling in [public/styles.css](public/styles.css).