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>
<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

{
  "footer": {
    "copyright": "Copyright © 2023-present <a href=\"https://www.limosa.io\">Limosa Digital Identity Solutions</a>"
  },
  "search": {
    "provider": "local"
  },
  "nav": [
    {
      "text": "Home",
      "link": "/"
    },
    {
      "text": "Get Access",
      "link": "/apikey/"
    },
    {
      "text": "Playground",
      "link": "/playground/"
    },
    {
      "text": "",
      "items": [
        {
          "text": "Guide",
          "link": "/guide/"
        },
        {
          "text": "Contact",
          "link": "/contact/"
        }
      ]
    }
  ],
  "sidebar": {
    "/guide/": [
      {
        "text": "API",
        "items": [
          {
            "text": "Endpoints",
            "link": "/guide/api/"
          },
          {
            "text": "Postman",
            "link": "/guide/api/postman"
          }
        ]
      },
      {
        "text": "Applications",
        "link": "/guide/applications/",
        "items": [
          {
            "text": "Microsoft Entra ID",
            "link": "/guide/applications/microsoftentraid"
          },
          {
            "text": "Okta",
            "link": "/guide/applications/okta"
          },
          {
            "text": "SailPoint",
            "link": "/guide/applications/sailpoint"
          },
          {
            "text": "OneLogin",
            "link": "/guide/applications/onelogin"
          },
          {
            "text": "Omada",
            "link": "/guide/applications/omada"
          }
        ]
      },
      {
        "text": "SCIM relationships",
        "link": "/guide/relationships/",
        "items": [
          {
            "text": "OAuth",
            "link": "/guide/relationships/oauth"
          },
          {
            "text": "OpenID Connect",
            "link": "/guide/relationships/openid-connect"
          }
        ]
      },
      {
        "text": "Playgrounds",
        "link": "/guide/playgrounds/"
      }
    ],
    "/playground/": [
      {
        "text": "Playground",
        "link": "/playground/",
        "items": [
          {
            "text": "Data Generator",
            "link": "/playground/generator"
          }
        ]
      },
      {
        "text": "SCIM Endpoints",
        "items": [
          {
            "text": "Users",
            "link": "/playground/users"
          },
          {
            "text": "Groups",
            "link": "/playground/groups"
          },
          {
            "text": "Me",
            "link": "/playground/me"
          },
          {
            "text": "Resource Types",
            "link": "/playground/resource-types"
          },
          {
            "text": "Schemas",
            "link": "/playground/schemas"
          },
          {
            "text": "Service Provider Config",
            "link": "/playground/service-provider-config"
          },
          {
            "text": "Bulk",
            "link": "/playground/bulk"
          },
          {
            "text": "Custom",
            "link": "/playground/custom"
          },
          {
            "text": "ETag",
            "link": "/playground/etag"
          }
        ]
      },
      {
        "text": "Manager",
        "link": "/playground/manager/",
        "items": [
          {
            "text": "User Manager",
            "link": "/playground/manager/user-manager"
          },
          {
            "text": "Group Manager",
            "link": "/playground/manager/group-manager"
          }
        ]
      },
      {
        "text": "Logs",
        "items": [
          {
            "text": "HTTP Log",
            "link": "/playground/logs"
          }
        ]
      },
      {
        "text": "OpenID SSF",
        "link": "/playground/sharedsignalframework/",
        "items": [
          {
            "text": "Configuration",
            "link": "/playground/sharedsignalframework/configuration"
          },
          {
            "text": "Stream",
            "link": "/playground/sharedsignalframework/stream"
          },
          {
            "text": "Verify",
            "link": "/playground/sharedsignalframework/verify"
          },
          {
            "text": "Status",
            "link": "/playground/sharedsignalframework/status"
          },
          {
            "text": "Events",
            "link": "/playground/sharedsignalframework/events"
          },
          {
            "text": "CAEP",
            "link": "/playground/sharedsignalframework/caep"
          }
        ]
      },
      {
        "text": "OpenID Connect",
        "link": "/playground/openidconnect/",
        "items": [
          {
            "text": "Configuration",
            "link": "/playground/openidconnect/configuration"
          },
          {
            "text": "ID Token",
            "link": "/playground/openidconnect/idtoken"
          }
        ]
      }
    ]
  },
  "socialLinks": [
    {
      "icon": "github",
      "link": "https://github.com/arietimmerman/laravel-scim-server"
    }
  ]
}

Page Data

{
  "title": "Runtime API Examples",
  "description": "",
  "frontmatter": {
    "outline": "deep",
    "head": [
      [
        "link",
        {
          "rel": "canonical",
          "href": "https://scim.dev/api-examples.html"
        }
      ]
    ]
  },
  "headers": [],
  "relativePath": "api-examples.md",
  "filePath": "api-examples.md",
  "lastUpdated": 1698701811000
}

Page Frontmatter

{
  "outline": "deep",
  "head": [
    [
      "link",
      {
        "rel": "canonical",
        "href": "https://scim.dev/api-examples.html"
      }
    ]
  ]
}

More

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

Last updated: