Skip to content

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

{
  "siteTitle": "KeyRunner",
  "lastUpdated": {
    "text": "Updated at",
    "formatOptions": {
      "dateStyle": "full",
      "timeStyle": "medium"
    }
  },
  "footer": {
    "message": "Released under the MIT License.",
    "copyright": "Copyright © 2025-LaunchIAM inc."
  },
  "search": {
    "provider": "local"
  },
  "editLink": {
    "pattern": "https://github.com/launchiamenterprise/keyrunner/wiki",
    "text": "Edit this page on GitHub"
  },
  "nav": [
    {
      "text": "Documentation",
      "link": "/docs/"
    },
    {
      "text": "Blog",
      "link": "/blog/"
    },
    {
      "text": "VS Code Extension",
      "link": "https://marketplace.visualstudio.com/items?itemName=KeyRunner.keyrunner"
    },
    {
      "text": "Desktop App",
      "link": "https://keyrunner.app"
    },
    {
      "text": "KeyRunner Vs Postman",
      "link": "/compare/compareKeyrunner"
    }
  ],
  "sidebar": {
    "docs": [
      {
        "text": "Introduction",
        "collapsed": false,
        "items": [
          {
            "text": "Overview",
            "link": "docs/Introduction"
          },
          {
            "text": "Support and Feedback",
            "link": "docs/Feedback"
          }
        ]
      },
      {
        "text": "Get Started",
        "collapsed": false,
        "items": [
          {
            "text": "Download",
            "link": "docs/Download"
          },
          {
            "text": "Getting Started",
            "link": "docs/GettingStarted"
          },
          {
            "text": "Creating Your First Request and Collection",
            "link": "docs/FirstRequest"
          },
          {
            "text": "Setting up Environment",
            "link": "docs/Environment"
          },
          {
            "text": "Import/Export",
            "link": "docs/ImportandExport",
            "items": [
              {
                "text": "Postman Migration/Import Collections",
                "link": "docs/PostmanMigration"
              },
              {
                "text": "Postman Bulk Migration",
                "link": "docs/PostmanBulkMigration"
              },
              {
                "text": "Thunderclient Migration/Import Collections",
                "link": "docs/ThunderclientMigration"
              }
            ]
          }
        ]
      },
      {
        "text": "Solutions",
        "collapsed": false,
        "items": [
          {
            "text": "Postman Alternative",
            "link": "/docs/PostmanAlternative"
          },
          {
            "text": "Secure AI Agent Execution",
            "link": "/docs/SecureAIAgentExecution"
          },
          {
            "text": "Vault for API Credentials",
            "link": "/docs/VaultForApiCredentials"
          }
        ]
      },
      {
        "text": "Sending Requests",
        "collapsed": false,
        "items": [
          {
            "text": "Creating Requests with Authorization",
            "link": "docs/CreatingRequests"
          },
          {
            "text": "Viewing Response",
            "link": "docs/ViewingResponse"
          },
          {
            "text": "Managing Cookies",
            "link": "docs/ManagingCookies"
          },
          {
            "text": "Grouping Requests in Collections",
            "link": "docs/GroupingRequests"
          },
          {
            "text": "Request Body Types",
            "link": "docs/RequestBodyTypes"
          },
          {
            "text": "API Documentation & Code Generation",
            "link": "docs/DocumentationCode"
          }
        ]
      },
      {
        "text": "Flows: Simplifying API Flow Creation and Visualization",
        "collapsed": false,
        "items": [
          {
            "text": "Creating first Flow",
            "link": "docs/Flows"
          },
          {
            "text": "Workflow Builder",
            "link": "docs/Flowbuilder"
          }
        ]
      },
      {
        "text": "Collections",
        "collapsed": false,
        "items": [
          {
            "text": "Running a collection",
            "link": "docs/Collections"
          }
        ]
      },
      {
        "text": "KeyRunner CLI : Command Line Interface",
        "collapsed": false,
        "items": [
          {
            "text": "Overview & Usage",
            "link": "docs/CLI"
          }
        ]
      },
      {
        "text": "Integrations",
        "collapsed": false,
        "items": [
          {
            "text": "Overview",
            "link": "docs/IntegrationsOverview"
          },
          {
            "text": "Git Integration",
            "link": "docs/gitIntegration"
          },
          {
            "text": "MTLS",
            "link": "docs/mtls"
          },
          {
            "text": "Scripting",
            "link": "docs/scripting"
          },
          {
            "text": "Kafka Integration",
            "link": "docs/kafka"
          },
          {
            "text": "External Libraries",
            "link": "docs/ExternalLibraries.md"
          },
          {
            "text": "Secret Stores",
            "items": [
              {
                "text": "HashiCorp Vault",
                "link": "docs/hashicorp"
              },
              {
                "text": "AWS Secrets Manager",
                "link": "docs/AWSSecretsManager"
              },
              {
                "text": "Google Secrets Manager",
                "link": "docs/GoogleSecretsManager"
              },
              {
                "text": "Azure Key Vault",
                "link": "docs/AzureKeyVault"
              },
              {
                "text": "1Password",
                "link": "docs/1Password"
              }
            ]
          },
          {
            "text": "API management",
            "items": [
              {
                "text": "Sensedia",
                "link": "docs/sensedia"
              },
              {
                "text": "Apigee",
                "link": "docs/apigee"
              }
            ]
          }
        ]
      },
      {
        "text": "Secrets Scanner",
        "collapsed": false,
        "items": [
          {
            "text": "Getting Started",
            "link": "docs/SecretScanner"
          }
        ]
      },
      {
        "text": "Request Validator",
        "collapsed": false,
        "items": [
          {
            "text": "OWASP Top 10",
            "link": "docs/RequestValidator"
          }
        ]
      },
      {
        "text": "Testing",
        "collapsed": false,
        "items": [
          {
            "text": "No-Code Testing with KeyRunner: Simplifying Response Validation",
            "link": "docs/Testing"
          },
          {
            "text": "Mock Servers",
            "link": "docs/mockservers"
          }
        ]
      },
      {
        "text": "AI Agent Governance",
        "collapsed": false,
        "items": [
          {
            "text": "Introduction",
            "link": "/docs/Enterprise/ControlPlane/"
          },
          {
            "text": "Agents",
            "link": "/docs/Enterprise/ControlPlane/agents"
          },
          {
            "text": "Tools",
            "link": "/docs/Enterprise/ControlPlane/tools"
          },
          {
            "text": "Policies",
            "link": "/docs/Enterprise/ControlPlane/policies"
          },
          {
            "text": "Approvals",
            "link": "/docs/Enterprise/ControlPlane/approvals"
          },
          {
            "text": "Audit Logs",
            "link": "/docs/Enterprise/ControlPlane/audit-logs"
          },
          {
            "text": "Agent Graph",
            "link": "/docs/Enterprise/ControlPlane/agent-graph"
          },
          {
            "text": "Preflight",
            "link": "/docs/Enterprise/ControlPlane/preflight"
          },
          {
            "text": "Policy Playground",
            "link": "/docs/Enterprise/ControlPlane/playground"
          },
          {
            "text": "Governance Concepts",
            "link": "/docs/Enterprise/ControlPlane/governance-concepts"
          },
          {
            "text": "Connecting Your Agent",
            "link": "/docs/Enterprise/ControlPlane/sdk-api"
          }
        ]
      },
      {
        "text": "Enterprise",
        "collapsed": false,
        "items": [
          {
            "text": "Security Model",
            "link": "/docs/Enterprise/Securitymodel/securitymodel.md",
            "items": [
              {
                "text": "Security Model",
                "link": "/docs/Enterprise/Securitymodel/securitymodel.md"
              },
              {
                "text": "Authentication & Identity",
                "link": "/docs/Enterprise/Securitymodel/authentication.md"
              },
              {
                "text": "User Management",
                "link": "docs/Enterprise/Securitymodel/usermanagement.md"
              },
              {
                "text": "Audit & Logs",
                "link": "docs/Enterprise/Securitymodel/auditlogs.md"
              }
            ]
          },
          {
            "text": "Getting Started",
            "link": "/docs/Enterprise/gettingstarted"
          },
          {
            "text": "SSO Configuration",
            "link": "/docs/Enterprise/SSOConfiguration"
          },
          {
            "text": "SCIM(System for Cross-domain Identity Management)",
            "link": "/docs/Enterprise/SCIM"
          },
          {
            "text": "KeyConnector",
            "link": "/docs/Enterprise/keyconnector"
          },
          {
            "text": "Variables in Enterprise",
            "link": "/docs/Enterprise/variables"
          },
          {
            "text": "Project Onboarding",
            "link": "/docs/Enterprise/projectonboarding"
          },
          {
            "text": "Workspaces",
            "link": "/docs/Enterprise/workspaceonboarding"
          },
          {
            "text": "Monitoring",
            "link": "/docs/Enterprise/monitoring"
          }
        ]
      }
    ],
    "blog": []
  },
  "socialLinks": [
    {
      "icon": "github",
      "link": "https://github.com/launchiamenterprise/keyrunner"
    }
  ]
}

Page Data

{
  "title": "Runtime API Examples",
  "description": "Runtime API Examples This page demonstrates usage of some of the runtime APIs provided by VitePress. The main API can be used to access site, theme, and page.",
  "frontmatter": {
    "outline": "deep"
  },
  "headers": [],
  "relativePath": "docs/api-examples.md",
  "filePath": "docs/api-examples.md",
  "lastUpdated": 1705805221000
}

Page Frontmatter

{
  "outline": "deep"
}

More

Check out the documentation for the full list of runtime APIs.

Released under the MIT License.