Docs

Search documentation

Jump to a documentation page.

PricingMarketingApp

Search documentation

Jump to a documentation page.

Seo

SEO & discoverability

YourNextSaaS treats SEO as a first-class concern for public routes on the marketing app (/, /pricing, /legal/*). Authenticated areas, APIs, onboarding, and debug routes are noindex so internal UI does not compete with marketing pages in search results.

What you get out of the box

CapabilityWhere it lives
Title & meta description per public routeRoute head() + publicSeoMeta() in packages/shared/src/lib/seo-meta.ts
Canonical URLsEmitted when VITE_SITE_URL is set
Open Graph & Twitter / X cardsSame helper: og:*, twitter:*, image alt text, locale
RobotsPublic pages: index/follow with Google’s max-image-preview:large style hints; app shell uses noindex,nofollow via appAreaRobots() where applied
JSON-LDHome: WebSite, Organization, SoftwareApplication; home FAQ: FAQPage; pricing & legal: BreadcrumbList
SitemapGET /sitemap.xml on marketingapps/marketing/src/routes/sitemap[.]xml.ts
Crawling policyapps/marketing/public/robots.txt — allows /, disallows app-only paths, /api/, etc.

Required configuration

Set VITE_SITE_URL on the marketing deployment to your public origin (no trailing slash), for example https://yournextsaas.xyz. Without it, canonical links, absolute OG URLs, JSON-LD @id values, and the sitemap still work in development using a localhost fallback, but production should always set this so social crawlers and search engines see consistent absolute URLs.

Replace apps/marketing/public/og-default.png with a real 1200×630 (or similar) social preview image. Meta tags advertise dimensions via og:image:width / og:image:height (see defaultOgImageWidth / defaultOgImageHeight in packages/core/src/config/site.ts); align the file with those values when you ship.

Optional environment variables

VariablePurpose
VITE_GOOGLE_SITE_VERIFICATIONContent value for <meta name="google-site-verification"> (Search Console domain verification)
VITE_TWITTER_SITEHandle without @; adds twitter:site and twitter:creator

Document these in your deployment provider; they are referenced from packages/core/src/config/site.ts and packages/shared/src/lib/seo-meta.ts.

FAQ content and JSON-LD

Landing FAQ copy and FAQPage structured data share one source: packages/shared/src/lib/landing-faq.ts via getLandingFaqItems(locale) (English and Arabic today). The home route head() passes the active UI locale so meta description, og:locale, and FAQ JSON-LD match the language the user chose (cookie yns_locale). See i18n & RTL for how locale is resolved and how to add strings or languages.

Adding a new public page

  1. Create the route under apps/marketing/src/routes/.
  2. In head(), call publicSeoMeta({ title, path, description }) (and optionally keywords: false for legal-style pages).
  3. For nested marketing pages, merge breadcrumbs: withJsonLd(seo, breadcrumbJsonLdScript([{ name: "Home", path: "/" }, …])).
  4. Append the path to apps/marketing/src/routes/sitemap[.]xml.ts ENTRIES with an appropriate priority / changefreq.

Files to know

  • packages/shared/src/lib/seo-meta.ts — helpers: publicSeoMeta, withJsonLd, breadcrumbJsonLdScript, faqJsonLdScript, websiteJsonLdScript, appAreaRobots
  • packages/core/src/config/site.tssiteName, defaultSiteDescription, defaultSiteKeywords, OG defaults
  • apps/marketing/src/routes/__root.tsx — global head: charset, viewport, theme-color, manifest, icons
  • apps/marketing/public/robots.txt — crawl rules; sitemap URL is relative (Sitemap: /sitemap.xml)

Verification checklist (launch)

  1. Set VITE_SITE_URL in production for the marketing app.
  2. Upload a proper OG image and match dimensions in config if needed.
  3. Submit https://<your-domain>/sitemap.xml in Google Search Console (and Bing Webmaster Tools if you use it).
  4. Use “URL Inspection” / sharing debuggers (Facebook, LinkedIn, X) to confirm previews.
  5. Confirm authenticated / internal URLs return noindex in the HTML head where intended.