import type { Metadata } from 'next' import { readFileSync } from 'fs' import path from 'path' export const metadata: Metadata = { title: 'Privacy Policy', description: 'OpenCode Mobile privacy policy. We do not collect your code, prompts, or AI responses. Crash diagnostics (Sentry), usage analytics (PostHog), and shared support reports (Chatwoot) are opt-in only.', alternates: { canonical: 'https://opencode.agentlabs.cc/privacy' }, openGraph: { title: 'Privacy Policy | OpenCode Mobile', description: 'OpenCode Mobile privacy policy — minimal data collection, opt-in crash reporting and analytics.', url: 'https://opencode.agentlabs.cc/privacy', }, } export default function PrivacyPage() { // Read the canonical privacy policy HTML generated by the Android distribution workflow. // This ensures the policy shown on the site is always in sync with app store submissions. const policyPath = path.join( process.cwd(), '../../../opencode-mobile/distribution/privacy-policy.html', ) let policyHtml = '' try { const raw = readFileSync(policyPath, 'utf8') // Extract just the
content so we can render it inside our layout const bodyMatch = raw.match(/]*>([\s\S]*?)<\/body>/i) policyHtml = bodyMatch ? bodyMatch[1] : raw } catch { policyHtml = `Privacy policy document not found. Please contact support@agentlabs.cc.
` } return (