Runtime API Examples
This page demonstrates usage of some of the runtime APIs provided by VitePress.
The main useData() API can be used to access site, theme, and page data for the current page. It works in both .md and .vue files:
md
<script setup>
import { useData } from 'vitepress'
const { theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>Results
Theme Data
{
"logo": "/vite.svg",
"siteTitle": "iNET Portal Docs",
"nav": [
{
"text": "Home",
"link": "/"
},
{
"text": "MCP Server",
"link": "/mcp-server/"
},
{
"text": "one-toolkit",
"link": "/one-toolkit/"
},
{
"text": "eKYC",
"link": "/ekyc/"
},
{
"text": "OpenStack Backup",
"link": "/openstack-backup/"
},
{
"text": "API Examples",
"link": "/api-examples"
},
{
"text": "n8n",
"link": "/n8n/"
},
{
"text": "Auto Docs",
"link": "/auto-docs/"
},
{
"text": "Note cá nhân",
"link": "/personal-notes/"
}
],
"sidebar": {
"/ekyc/": [
{
"text": "🎓 eKYC & Face Liveness",
"items": [
{
"text": "00. Case Study",
"link": "/ekyc/00-case-study"
},
{
"text": "📖 Tổng quan",
"link": "/ekyc/"
}
]
},
{
"text": "📚 Phần 1: Foundations",
"items": [
{
"text": "01. Tổng quan hệ thống",
"link": "/ekyc/01-overview"
},
{
"text": "02. Chi tiết flow steps",
"link": "/ekyc/02-flow-steps"
}
]
},
{
"text": "🔧 Phần 2: MediaPipe & Camera",
"items": [
{
"text": "03. Giới thiệu MediaPipe",
"link": "/ekyc/03-mediapipe-intro"
},
{
"text": "04. Wrapper class",
"link": "/ekyc/04-wrapper-class"
},
{
"text": "05. Camera pipeline",
"link": "/ekyc/05-camera-pipeline"
},
{
"text": "06a. Face Detection Fundamentals",
"link": "/ekyc/06a-face-detection-fundamentals"
},
{
"text": "06b. Liveness Calculation",
"link": "/ekyc/06-liveness-calculation"
},
{
"text": "07. Backend integration",
"link": "/ekyc/07-backend-integration"
},
{
"text": "08a. Xử lý Ward/District/Province",
"link": "/ekyc/08a-ward-processing"
},
{
"text": "08b. Review & Check2FA",
"link": "/ekyc/08-review-check2fa"
},
{
"text": "09. I18n & UX",
"link": "/ekyc/09-i18n-ux"
}
]
},
{
"text": "⚛️ Phần 3: Vue Specific",
"items": [
{
"text": "10. Vue Pros & Cons",
"link": "/ekyc/10-vue-pros-cons"
}
]
},
{
"text": "⚠️ Phần 4: Production Issues",
"items": [
{
"text": "11. Production issue",
"link": "/ekyc/11-production-issue"
},
{
"text": "12. Vite plugin fix",
"link": "/ekyc/12-vite-plugin-fix"
}
]
}
],
"/n8n/": [
{
"text": "Module 1: Getting Started",
"items": [
{
"text": "Giới thiệu",
"link": "/n8n/01-getting-started/"
},
{
"text": "n8n là gì?",
"link": "/n8n/01-getting-started/01-what-is-n8n"
},
{
"text": "Cài đặt",
"link": "/n8n/01-getting-started/02-installation"
},
{
"text": "Giao diện",
"link": "/n8n/01-getting-started/03-interface-tour"
},
{
"text": "Workflow đầu tiên",
"link": "/n8n/01-getting-started/04-first-workflow"
}
]
},
{
"text": "Module 2: Core Concepts",
"items": [
{
"text": "Tổng quan",
"link": "/n8n/02-core-concepts/"
},
{
"text": "Nodes & Connections",
"link": "/n8n/02-core-concepts/01-nodes-connections"
},
{
"text": "Cấu trúc dữ liệu",
"link": "/n8n/02-core-concepts/02-data-structure"
},
{
"text": "Expressions & Variables",
"link": "/n8n/02-core-concepts/03-expressions-variables"
},
{
"text": "Luồng thực thi",
"link": "/n8n/02-core-concepts/04-execution-flow"
}
]
},
{
"text": "Module 3: Common Nodes",
"items": [
{
"text": "Tổng quan",
"link": "/n8n/03-common-nodes/"
},
{
"text": "Webhook & HTTP",
"link": "/n8n/03-common-nodes/01-webhook-http"
},
{
"text": "Schedule & Cron",
"link": "/n8n/03-common-nodes/02-schedule-cron"
},
{
"text": "Xử lý dữ liệu",
"link": "/n8n/03-common-nodes/03-data-transformation"
},
{
"text": "Logic Nodes",
"link": "/n8n/03-common-nodes/04-logic-nodes"
}
]
},
{
"text": "Module 4: Advanced Topics",
"items": [
{
"text": "Tổng quan",
"link": "/n8n/04-advanced/"
},
{
"text": "Function Node",
"link": "/n8n/04-advanced/01-function-node"
},
{
"text": "Xử lý lỗi",
"link": "/n8n/04-advanced/02-error-handling"
},
{
"text": "Sub-workflows",
"link": "/n8n/04-advanced/03-sub-workflows"
},
{
"text": "Authentication",
"link": "/n8n/04-advanced/04-authentication"
}
]
},
{
"text": "Module 5: Practical Examples",
"items": [
{
"text": "Tổng quan",
"link": "/n8n/05-examples/"
},
{
"text": "Telegram Bot",
"link": "/n8n/05-examples/01-telegram-bot"
},
{
"text": "Google Sheets",
"link": "/n8n/05-examples/02-google-sheets"
},
{
"text": "Email Automation",
"link": "/n8n/05-examples/03-email-automation"
}
]
}
],
"/auto-docs/": [
{
"text": "📚 Phần 1: Triết lý & Kiến trúc",
"items": [
{
"text": "01. Giới thiệu & Tư duy sản phẩm",
"link": "/auto-docs/01-introduction"
},
{
"text": "02. Kiến trúc hệ thống",
"link": "/auto-docs/02-system-architecture"
}
]
},
{
"text": "🛠️ Phần 2: Công nghệ lõi",
"items": [
{
"text": "03. Playwright & Ghi hình",
"link": "/auto-docs/03-playwright-core"
},
{
"text": "04. Động cơ AI & Prompt",
"link": "/auto-docs/04-ai-engine"
}
]
},
{
"text": "💻 Phần 3: Giao diện dòng lệnh",
"items": [
{
"text": "05. CLI & Chế độ tương tác",
"link": "/auto-docs/05-cli-interface"
},
{
"text": "06. Xác thực & Quản lý phiên",
"link": "/auto-docs/06-authentication"
}
]
},
{
"text": "📦 Phần 4: Đóng gói & Phân phối",
"items": [
{
"text": "07. Đóng gói ứng dụng",
"link": "/auto-docs/07-build-distribution"
}
]
},
{
"text": "🚀 Phần 5: Ứng dụng thực tế",
"items": [
{
"text": "08. Phân tích công nghệ",
"link": "/auto-docs/08-case-studies"
},
{
"text": "09. Xử lý sự cố & Tối ưu",
"link": "/auto-docs/09-troubleshooting-optimization"
}
]
}
],
"/openstack-backup/": [
{
"text": "☁️ OpenStack Backup Cloud Server",
"items": [
{
"text": "00. Case Study",
"link": "/openstack-backup/00-case-study"
},
{
"text": "📖 Tổng quan",
"link": "/openstack-backup/"
}
]
},
{
"text": "📚 Phần 1: Foundations",
"items": [
{
"text": "01. Tổng quan OpenStack",
"link": "/openstack-backup/01-openstack-overview"
},
{
"text": "02. Authentication",
"link": "/openstack-backup/02-authentication"
},
{
"text": "03. Snapshot & Backup",
"link": "/openstack-backup/03-snapshot-backup"
}
]
},
{
"text": "🔧 Phần 2: Scheduling & Queue",
"items": [
{
"text": "04. Schedule System",
"link": "/openstack-backup/04-schedule-system"
},
{
"text": "05. Queue Management",
"link": "/openstack-backup/05-queue-management"
},
{
"text": "06. Template System",
"link": "/openstack-backup/06-template-system"
}
]
},
{
"text": "⚙️ Phần 3: Advanced Topics",
"items": [
{
"text": "07. Multi-Location",
"link": "/openstack-backup/07-location-handling"
},
{
"text": "08. Snapshot Limits",
"link": "/openstack-backup/08-snapshot-limits"
},
{
"text": "09. Production Practices"
}
]
},
{
"text": "📚 Phần 1: Fundamentals",
"items": [
{
"text": "01. Vấn đề AI coding agents",
"link": "/one-toolkit/01-problem-first"
},
{
"text": "02. one-toolkit là gì?",
"link": "/one-toolkit/02-mental-model"
},
{
"text": "03. Kiến trúc tư duy",
"link": "/one-toolkit/03-architecture"
}
]
},
{
"text": "🔧 Phần 2: Practical Implementation",
"items": [
{
"text": "04. Quy trình SDLC thực tế",
"link": "/one-toolkit/04-sdlc-workflow"
},
{
"text": "05. Ví dụ thực tế: REST API",
"link": "/one-toolkit/05-real-example"
},
{
"text": "06. Ưu điểm cốt lõi",
"link": "/one-toolkit/06-core-benefits"
}
]
},
{
"text": "👥 Phần 3: Adoption & Best Practices",
"items": [
{
"text": "07. Phù hợp cho ai?",
"link": "/one-toolkit/07-who-should-use"
},
{
"text": "08. Best Practices",
"link": "/one-toolkit/08-best-practices"
},
{
"text": "09. Tổng kết & Decision Guide",
"link": "/one-toolkit/09-conclusion"
}
]
}
]
},
"socialLinks": [
{
"icon": "github",
"link": "https://github.com/inet-vn"
}
],
"footer": {
"message": "Internal documentation for iNET Portal",
"copyright": "Copyright © 2025 iNET"
},
"search": {
"provider": "local"
},
"editLink": {
"pattern": "https://github.com/inet-vn/portal/edit/main/documentation/src/:path",
"text": "Edit this page on GitHub"
},
"outline": {
"level": [
2,
3
],
"label": "On this page"
}
}Page Data
{
"title": "Runtime API Examples",
"description": "",
"frontmatter": {
"outline": "deep"
},
"headers": [],
"relativePath": "api-examples.md",
"filePath": "api-examples.md"
}Page Frontmatter
{
"outline": "deep"
}More
Check out the documentation for the full list of runtime APIs.