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
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
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
- Create the route under
apps/marketing/src/routes/. - In
head(), callpublicSeoMeta({ title, path, description })(and optionallykeywords: falsefor legal-style pages). - For nested marketing pages, merge breadcrumbs:
withJsonLd(seo, breadcrumbJsonLdScript([{ name: "Home", path: "/" }, …])). - Append the path to
apps/marketing/src/routes/sitemap[.]xml.tsENTRIESwith an appropriatepriority/changefreq.
Files to know
packages/shared/src/lib/seo-meta.ts— helpers:publicSeoMeta,withJsonLd,breadcrumbJsonLdScript,faqJsonLdScript,websiteJsonLdScript,appAreaRobotspackages/core/src/config/site.ts—siteName,defaultSiteDescription,defaultSiteKeywords, OG defaultsapps/marketing/src/routes/__root.tsx— global head: charset, viewport, theme-color, manifest, iconsapps/marketing/public/robots.txt— crawl rules; sitemap URL is relative (Sitemap: /sitemap.xml)
Verification checklist (launch)
- Set
VITE_SITE_URLin production for the marketing app. - Upload a proper OG image and match dimensions in config if needed.
- Submit
https://<your-domain>/sitemap.xmlin Google Search Console (and Bing Webmaster Tools if you use it). - Use “URL Inspection” / sharing debuggers (Facebook, LinkedIn, X) to confirm previews.
- Confirm authenticated / internal URLs return
noindexin the HTML head where intended.