Skip to content
Shareglow

Open Graph fixes · Slack

No Slack preview for a single-page app

A client-rendered app (React, Vue, Svelte, Angular) sends every visitor the same index.html and fills in the <head> with JavaScript. Slack's crawler identifies itself as Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots) and does not run that JavaScript, so it only ever sees the shell's default tags, or none.

Diagnosis

Why it happens on Slack

Scanner checks: og-title-present, og-image-present, og-url-matches

The fix

Fix it step by step

  1. Scan a deep link of your app: if the scanner sees the shell's tags, so does Slack.
  2. Best fix: render the og:* tags on the server (SSR, static export or prerendering per route).
  3. Otherwise add an edge rule that serves a pre-rendered HTML snapshot when the User-Agent contains "slackbot-linkexpanding"; the meta tag generator has ready snippets for Cloudflare Workers, Next.js middleware and Vercel.
  4. Re-scan the same deep link and confirm the route's own title and image come back.
<title>Your page title</title>
<meta name="description" content="A one or two sentence summary of this page.">
<meta property="og:title" content="Your page title">
<meta property="og:description" content="A one or two sentence summary of this page.">
<meta property="og:image" content="https://example.com/og.png">
<meta property="og:url" content="https://example.com/page">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Your site name">
<meta name="twitter:card" content="summary_large_image">

Slack cache: Slack has no public refresh button and caches an unfurl for a while after a URL is first posted. Post the link with a new query string such as ?v=2 to get a fresh card, and remove the outdated preview from your own message.

Check your link on Slack

FAQ

Common questions

Does Slack's crawler run JavaScript?

No. It reads the HTML your server returns to Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots). Tags inserted by client-side JavaScript are not seen.

How do I detect Slack's crawler at the edge?

Match "slackbot-linkexpanding" in the lowercased User-Agent and serve a snapshot whose <head> holds the route's og:* tags. Humans keep getting the normal app.

No preview for a JavaScript app on other platforms