Skip to content

Operator-branded OpenGraph share cards#107

Open
ashwin47 wants to merge 4 commits into
mainfrom
og-image-operator-branding
Open

Operator-branded OpenGraph share cards#107
ashwin47 wants to merge 4 commits into
mainfrom
og-image-operator-branding

Conversation

@ashwin47

@ashwin47 ashwin47 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

What

Shared links to a Sabha instance now unfurl with the operator's own identity instead of a Sabha marketing image. When someone pastes their community's link into Slack, Discord, or iMessage, the preview card shows the operator's uploaded logo (or the Sabha mark as a fallback) above their account name, on a clean brand background with a small "powered by sabha" footer.

Why

The og:image tag previously hardcoded a sabha.co marketing image on every self-hosted and in-app surface. A self-hoster who had set their own app name, theme, and logo still saw a literal sabha.co ad on the one surface that matters most — the share card a prospective member sees first. The card is now rendered per-instance so it reflects whoever owns the surface.

How it works

  • og:image points at a new account-scoped endpoint that renders a 1200×630 PNG on the fly via libvips (the same image stack already used for logo variants — no ImageMagick dependency).
  • Current.account resolves the right identity automatically: the singleton account when self-hosted, the workspace account when running multi-tenant. The same code path therefore produces the operator's name on self-hosted and the workspace name inside a SaaS workspace.
  • The card is publicly cacheable with an ETag and a updated_at-based cache-buster, mirroring the existing logo endpoint.
  • The public sabha.co marketing layout is intentionally left untouched — it keeps its hand-made card.

Testing

  • Model, controller, and integration coverage for the rendered card, the logo-vs-stock-mark branches, the blank-name fallback, public caching, and 304 revalidation.
  • Full single-tenant and multi-tenant suites pass; the card was also rendered live inside a real workspace tenant to confirm it picks up the workspace name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant