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": "https://cloud.notside.com/pubflow/Pubflow-Favicon.png",
"nav": [
{
"text": "Home",
"link": "/"
},
{
"text": "Getting Started",
"link": "/getting-started"
},
{
"text": "Core Concepts",
"link": "/core-concepts/"
},
{
"text": "Guides",
"link": "/guides/"
},
{
"text": "Pubflow",
"link": "https://pubflow.com"
}
],
"sidebar": [
{
"text": "🚀 Getting Started",
"collapsed": false,
"items": [
{
"text": "Introduction",
"link": "/introduction"
},
{
"text": "What is Pubflow?",
"link": "/what-is-pubflow"
},
{
"text": "Quick Start",
"link": "/getting-started"
},
{
"text": "30-Minute Tutorial",
"link": "/tutorial"
}
]
},
{
"text": "🎯 Core Concepts",
"collapsed": false,
"items": [
{
"text": "Overview",
"link": "/core-concepts/"
},
{
"text": "Bridge Validation",
"link": "/core-concepts/bridge-validation"
},
{
"text": "Validation Modes",
"link": "/core-concepts/validation-modes"
},
{
"text": "HybridCache",
"link": "/core-concepts/hybridcache"
},
{
"text": "Trust Tokens (PASETO)",
"link": "/core-concepts/trust-tokens"
},
{
"text": "Auth Middleware",
"link": "/core-concepts/auth-middleware"
},
{
"text": "Multi-Database",
"link": "/core-concepts/multi-database"
},
{
"text": "Environment Config",
"link": "/core-concepts/environment"
}
]
},
{
"text": "📚 Guides",
"collapsed": false,
"items": [
{
"text": "HybridCache Guide",
"link": "/guides/hybridcache"
},
{
"text": "Trust Tokens Guide",
"link": "/guides/trust-tokens"
},
{
"text": "Email Templates",
"link": "/guides/email-templates"
},
{
"text": "Protected Routes",
"link": "/guides/protected-routes"
},
{
"text": "Database Setup",
"link": "/guides/database-setup"
},
{
"text": "Deployment",
"link": "/guides/deployment"
}
]
},
{
"text": "🌍 Language Implementations",
"collapsed": true,
"items": [
{
"text": "Flowfull-Node.js",
"link": "/languages/nodejs"
},
{
"text": "Flowfull-Go",
"link": "/languages/go"
},
{
"text": "Flowfull-Python",
"link": "/languages/python"
},
{
"text": "Flowfull-Rust",
"link": "/languages/rust"
}
]
},
{
"text": "🔧 API Reference",
"collapsed": true,
"items": [
{
"text": "Bridge API",
"link": "/api/bridge"
},
{
"text": "Cache API",
"link": "/api/cache"
},
{
"text": "Auth Middleware",
"link": "/api/middleware"
}
]
},
{
"text": "🤖 AI Context",
"items": [
{
"text": "Documentation Overview",
"link": "/llms.txt",
"target": "_blank"
},
{
"text": "Full Developer Context",
"link": "/llms-full.txt",
"target": "_blank"
}
]
}
],
"socialLinks": [
{
"icon": "github",
"link": "https://github.com/pubflow"
},
{
"icon": "discord",
"link": "https://discord.gg/EJfPTT6Vh7"
}
],
"footer": {
"message": "Part of the Pubflow Ecosystem: <a href=\"https://flowless.dev\" target=\"_blank\">Flowless</a> • <a href=\"https://clients.flowfull.dev\" target=\"_blank\">Clients</a> • <a href=\"https://bridgepayments.dev\" target=\"_blank\">Payments</a>",
"copyright": "Copyright © 2026 Pubflow"
},
"search": {
"provider": "local"
},
"editLink": {
"pattern": "https://github.com/pubflow/flowfull/edit/main/docs/:path",
"text": "Edit this page on GitHub"
}
}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.