Skip to content

Invoice Public Page Open Graph and SEO Metadata #509

Description

@Kingsman-99

Description

Sharing a public invoice status link on social media or in a messaging app generates a blank preview because the page lacks Open Graph meta tags. Proper OG and Twitter card metadata generated server-side from the invoice record must be added to the public invoice route.

Technical Context

src/app/invoice/[id]/public/page.tsx (or the existing public page route) uses Next.js App Router's generateMetadata async export to fetch the invoice and return { openGraph: { title, description, images } }. The OG image is a dynamic Next.js Image Response from src/app/og/route.tsx (new) using the @vercel/og package, rendering the invoice title, total, and status in a branded card layout. generateMetadata sets a robots: 'noindex' directive for draft invoices.

Acceptance Criteria

  • Pasting a public invoice URL into Slack or Twitter generates a preview card with the invoice title and amount
  • The <title> tag reads "Invoice #<id> — StellarSplit" or similar
  • The OG image is generated server-side and includes the invoice title, status, and total amount
  • Draft invoice pages include <meta name="robots" content="noindex"> to prevent indexing
  • generateMetadata does not block render; it runs in parallel with the page data fetch
  • All CI checks (npm test, npm run build, ESLint/TypeScript) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions