← Back to Blog

Why My Slack App's Website Contains No Slack Code

AnnMax · November 25, 20269 min read

The Line I Drew Between the App and Its Website

Every Slack app eventually needs a website, and the first thing I wrote for vkt-site was a boundary that is now a comment in the build config: this repository is not the Slack app. vktapp.com is a marketing site — Astro 5, pure static output, four devDependencies in total, and no server runtime of any kind. The install flow, the event webhooks, the Block Kit rendering, the request signing and the rate limiting all live in a separate repository behind api.vktapp.com.

I flag it because "Slack app website" implies an oauth.v2.authorize call somewhere, and mine has none. The astro.config.mjs header comment is blunter than I can be: static output, no adapter, no Worker, no Functions.

What the site does own is everything a crawler needs to decide the product is real and rankable: eleven pages, four shipping languages, structured data per page per language, and the legal set — privacy, terms, refund, DPA, subprocessors. Publishing is one line: astro build then npx wrangler pages deploy dist --project-name vkt-site, wired up as a single npm script.

One File, Forty-Four Pages, Zero Shipped JavaScript

The entire routing table is a single catch-all page that cross-products the page list — a plain array kept in the site config module — with the enabled locales:

return ENABLED_LOCALES.flatMap((locale) => routes.map((route) => {
  const prefix = locale.prefix.replace(/^\//, "");
  const path = [prefix, route.slug].filter(Boolean).join("/");
  return { params: { path: path || undefined }, props: { locale, key: route.key } };
}));

The reason is drift. With one file it is structurally impossible to ship a Chinese /features/ and forget the Japanese one — the failure mode of per-page files where languages are added by copy-paste. A new language is one locale entry plus a dictionary; navigation, hreflang, canonicals and the sitemap follow without a second edit.

The other property worth defending: the build ships no JavaScript. The output directory contains CSS and not a single JS chunk. Two inline scripts survive in the document: roughly twenty lines of scroll-reveal and roughly twenty lines of language bootstrap. Everything else is markup, so a crawler and a human on throttled 3G see the same page.

The Add to Slack Button Is Just a Hyperlink

Every call to action leaves the site, and the target is defined in four lines:

export const SLACK_INSTALL_URL =
  env.PUBLIC_SLACK_INSTALL_URL ||
  nodeEnv.PUBLIC_SLACK_INSTALL_URL ||
  "https://api.vktapp.com/slack/install";

That is the whole integration: no scope string assembled here, no state nonce, no token exchange, no signing secret read. The only OAuth URL in the project is an illustrative value in a README environment table — a way to point the link elsewhere, not code that runs.

The product has Slack surfaces, and the copy describes them without overselling: a Home tab of what needs you today, one-button approvals, and the slash commands /vkt-leave and /vkt-reports. The framing the site commits to is narrower still: Block Kit cannot draw an org chart and a modal cannot hold a forty-field form, so Slack is where you are told and where you tap once, and the browser is where the real work happens.

The same honesty applies to the security claims. Tenant isolation with a workspace id on every table and as the first argument of every repository method, bot tokens sealed with AES-256-GCM before they reach the database, Slack OIDC for sign-in, and a browser that never holds a Slack token — all true, all in the other repo. A marketing page can assert it but cannot test it, and that asymmetry is the best argument for the split.

Language Is Data, and the Redirect Is a Client Script

The interesting decision is what I did not do. Most multilingual sites sniff Accept-Language at the edge and answer with a 302. I went the other way: a page's canonical language is whatever its URL says, and auto-switching is a synchronous inline script in the head.

var p = location.pathname, s = p.split("/").filter(Boolean)[0] || "", cur = E.indexOf(s) > -1 ? s : D;
if (cur !== D) return;               // a prefixed URL is the user's own choice
if (p !== "/" && p !== "") {
  var r = document.referrer || "";
  if (r && r.indexOf(location.origin) !== 0) return;   // keep the page from search
}

Two reasons, both recorded in the repo. Googlebot sends Accept-Language: en-US and nothing else, so a 302 means the crawler never sees the German page. A URL whose body depends on a request header is also textbook doorway-page territory. The script avoids both: the crawler gets the HTML for the URL it requested, the human is moved before first paint, so there is no flash of English to design around.

The rules are narrow on purpose. Only default-locale URLs are candidates; a prefixed URL never gets hijacked; a visitor who arrived from a search result keeps the version they clicked, because otherwise long-tail English queries bounce straight into Chinese; and a stored preference outranks the browser. Nine cases drive an installed Chrome through exactly those paths; the harness fakes navigator.languages and document.referrer, and a second check script gates key parity across the locale dictionaries. hreflang and x-default come from the same ENABLED_LOCALES list the catch-all route iterates, and the shared base layout emits them, so a half-translated language physically cannot publish an alternate pointing at a 404.

The Half Nobody Writes Up

The rest is compliance and bytes. The sitemap is hand-written as a Response rather than generated by the sitemap integration, because a known-good file from a sister site exists, and I matched its framing: UTF-8 BOM, CRLF, only loc / lastmod / priority, no changefreq, and deliberately no hreflang duplicates — the page head already carries the alternates, and two copies only drift apart.

const BOM = "\uFEFF";
const NL = "\r\n";

Neither is required by the spec; both are in the file Google already reads, so the diff has nothing to explain. Hardening is two small files copied verbatim into the build: one that sets a CSP allowing self, inline styles and one analytics origin, and one that carries a single www-to-apex 301.

Legal text goes the opposite way from instinct. Only English is authoritative. Japanese and German still generate /ja/privacy/ and /de/terms/ so navigation and hreflang do not point at holes, but the body is the English original under a "the English version governs" note — signing a translated policy takes on interpretation risk, and a machine-translated German notice is more exposed than the English original, not less.

Pricing copy has to stay literally true in four languages. The seven modules the DPA names — org chart, directory, weekly reports, time off, approvals, people calendar, lifecycle — are free for up to 20 employees, $5 per extra person from the 21st; Service Desk is $8 per agent per month, sold through Creem as merchant of record, refundable within 14 days, with checkout at app.vktapp.com/billing. Numbers drift faster than words.

Finally, a deploy rule that cost a real debugging round: wrangler reads the ambient git branch, so without --branch main the site publishes to a preview URL while production serves 404s.

None of this is clever; it is what survives contact with a search engine. The project stays small because of the boundary I drew first: the website describes the product, the backend is the product.

Related Articles