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

{
  "nav": [
    {
      "text": "Home",
      "link": "/"
    },
    {
      "text": "Introduction",
      "link": "/doc/introduction"
    }
  ],
  "search": {
    "provider": "local"
  },
  "aside": true,
  "docFooter": {
    "next": true,
    "prev": true
  },
  "logo": {
    "light": "/img/mini.svg",
    "dark": "/img/mini.svg"
  },
  "footer": {
    "message": "Released under the MIT License.",
    "copyright": "Copyright © 2022-present Ame App Api"
  },
  "sidebar": [
    {
      "text": "Introduction",
      "items": [
        {
          "text": "get started",
          "link": "/doc/introduction"
        },
        {
          "text": "Runtime API Examples",
          "link": "/api-examples"
        }
      ]
    },
    {
      "text": "API Reference",
      "items": [
        {
          "text": "App services",
          "items": [
            {
              "text": "Get All",
              "link": "/doc/app/services/all"
            },
            {
              "text": "Get By Service_Id",
              "link": "/doc/app/services/by-service_id"
            },
            {
              "text": "Get By UserId",
              "link": "/doc/app/services/by-user_id"
            },
            {
              "text": "Get By State",
              "link": "/doc/app/services/by-state"
            },
            {
              "text": "Bill For Service",
              "items": [
                {
                  "text": "Get All Bill",
                  "link": "/doc/app/services/bill/all"
                },
                {
                  "text": "Get Bill For service_id",
                  "link": "/doc/app/services/bill/by-service_id"
                },
                {
                  "text": "Get All Bill By user_id",
                  "link": "/doc/app/services/bill/by-user_id"
                },
                {
                  "text": "Get Bill By bill_id",
                  "link": "/doc/app/services/bill/by-bill_id"
                },
                {
                  "text": "Get Bill By type",
                  "link": "/doc/app/services/bill/by-type"
                }
              ]
            },
            {
              "text": "Patient Create Service",
              "items": [
                {
                  "text": "Medication Collection",
                  "link": "/doc/app/services/create/users/medication-collection"
                },
                {
                  "text": "Organization",
                  "link": "/doc/app/services/create/users/organization"
                },
                {
                  "text": "Take Examens",
                  "link": "/doc/app/services/create/users/take-examens"
                },
                {
                  "text": "Prevention",
                  "link": "/doc/app/services/create/users/prevention"
                }
              ]
            },
            {
              "text": "Nurse Get Service",
              "items": [
                {
                  "text": "Organization",
                  "link": "/doc/app/services/get/nurse/get-organization"
                },
                {
                  "text": "Take Examens",
                  "link": "/doc/app/services/get/nurse/get-take-examens"
                },
                {
                  "text": "Prevention",
                  "link": "/doc/app/services/get/nurse/get-prevention"
                },
                {
                  "text": "Finish Service",
                  "items": [
                    {
                      "text": "Finish Prevention",
                      "link": "/doc/app/services/finish/nurse/finish-prevention"
                    },
                    {
                      "text": "Finish Take Examens",
                      "link": "/doc/app/services/finish/nurse/finish-take-examens"
                    },
                    {
                      "text": "Finish Organization",
                      "link": "/doc/app/services/finish/nurse/finish-organization"
                    }
                  ]
                }
              ]
            },
            {
              "text": "Delivery Get Service",
              "items": [
                {
                  "text": "Medication Collection",
                  "link": "/doc/app/services/get/delivery/get-collection"
                },
                {
                  "text": "Update Service",
                  "link": "/doc/app/services/update/delivery/update-collection"
                },
                {
                  "text": "Finish Service",
                  "link": "/doc/app/services/finish/delivery/finish-collection"
                }
              ]
            }
          ]
        },
        {
          "text": "Admin Services",
          "items": [
            {
              "text": "Email",
              "items": [
                {
                  "text": "Get All Emails",
                  "link": "/doc/admin/email/all"
                },
                {
                  "text": "Get Last Email",
                  "link": "/doc/admin/email/last"
                },
                {
                  "text": "Filter Emails",
                  "link": "/doc/admin/email/filter"
                }
              ]
            },
            {
              "text": "Notifications",
              "items": [
                {
                  "text": "Send Notification All users",
                  "link": "/doc/admin/notification/sen-all"
                },
                {
                  "text": "Send Notification By Id",
                  "link": "/doc/admin/notification/sen-by-user_id"
                },
                {
                  "text": "Send to all Delivery",
                  "link": "/doc/admin/notification/send-to-all-delivery"
                },
                {
                  "text": "Send to all Patient",
                  "link": "/doc/admin/notification/send-to-all-patient"
                },
                {
                  "text": "Send to all Nurse",
                  "link": "/doc/admin/notification/send-to-all-nurse"
                }
              ]
            }
          ]
        },
        {
          "text": "Users",
          "items": [
            {
              "text": "Get All users",
              "link": "/doc/users/all"
            },
            {
              "text": "Get User by Id",
              "link": "/doc/users/by-id"
            },
            {
              "text": "Get user by Type",
              "link": "/doc/users/by-type"
            },
            {
              "text": "Get user by Name",
              "link": "/doc/users/search"
            },
            {
              "text": "Get user by State",
              "link": "/doc/users/by-state"
            },
            {
              "text": "Delivery",
              "items": [
                {
                  "text": "Get All Services",
                  "link": "/doc/users/getDeliveryServices"
                },
                {
                  "text": "Get Service by Id",
                  "link": "/doc/users/getDeliveryServiceById"
                },
                {
                  "text": "Get Service by Type",
                  "link": "/doc/users/getDeliveryServiceByType"
                },
                {
                  "text": "Get Service by State",
                  "link": "/doc/users/getDeliveryServiceByState"
                },
                {
                  "text": "Payment information",
                  "items": [
                    {
                      "text": "Get Payment Information",
                      "link": "/doc/users/getPaymentInformation"
                    },
                    {
                      "text": "Get Payments List",
                      "link": "/doc/users/getPayments"
                    },
                    {
                      "text": "Get Payment History",
                      "link": "/doc/users/getPaymentById"
                    }
                  ]
                }
              ]
            },
            {
              "text": "nurse",
              "items": [
                {
                  "text": "Get All Services",
                  "link": "/doc/users/getDeliveryServices"
                },
                {
                  "text": "Get Service by Id",
                  "link": "/doc/users/getDeliveryServiceById"
                },
                {
                  "text": "Get Service by Type",
                  "link": "/doc/users/getDeliveryServiceByType"
                },
                {
                  "text": "Get Service by State",
                  "link": "/doc/users/getDeliveryServiceByState"
                },
                {
                  "text": "Payment information",
                  "items": [
                    {
                      "text": "Get Payment Information",
                      "link": "/doc/users/getPaymentInformation"
                    },
                    {
                      "text": "Get Payments List",
                      "link": "/doc/users/getPayments"
                    },
                    {
                      "text": "Get Payment History",
                      "link": "/doc/users/getPaymentById"
                    }
                  ]
                },
                {
                  "text": "Get Patient",
                  "items": [
                    {
                      "text": "Get Patient by Id",
                      "link": "/doc/users/getPatientById"
                    },
                    {
                      "text": "Get Patient by Name",
                      "link": "/doc/users/getPatientByName"
                    },
                    {
                      "text": "Get Reminder by PatientId",
                      "link": "/doc/users/getReminderByPatientId"
                    }
                  ]
                }
              ]
            },
            {
              "text": "patient",
              "items": [
                {
                  "text": "Get All Patients",
                  "link": "/doc/users/getPatients"
                },
                {
                  "text": "Get All Services",
                  "link": "/doc/users/getDeliveryServices"
                },
                {
                  "text": "Get Service by Id",
                  "link": "/doc/users/getDeliveryServiceById"
                },
                {
                  "text": "Get Service by Type",
                  "link": "/doc/users/getDeliveryServiceByType"
                },
                {
                  "text": "Get Service by State",
                  "link": "/doc/users/getDeliveryServiceByState"
                },
                {
                  "text": "Get attendants",
                  "items": [
                    {
                      "text": "Get All attendants",
                      "link": "/doc/users/getAttendants"
                    },
                    {
                      "text": "Get attendant by Id",
                      "link": "/doc/users/getAttendantById"
                    }
                  ]
                },
                {
                  "text": "Payment information",
                  "items": [
                    {
                      "text": "Get Payment Information",
                      "link": "/doc/users/getPaymentInformation"
                    },
                    {
                      "text": "Get Payments List",
                      "link": "/doc/users/getPayments"
                    },
                    {
                      "text": "Get Payment History",
                      "link": "/doc/users/getPaymentById"
                    },
                    {
                      "text": "Get Payment Cards",
                      "link": "/doc/users/getPaymentCards"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "text": "Reminders",
          "items": [
            {
              "text": "Get All",
              "link": "/doc/reminders/getAll"
            },
            {
              "text": "Get By Id",
              "link": "/doc/reminders/getById"
            },
            {
              "text": "Get By UserId",
              "link": "/doc/reminders/getByUserId"
            }
          ]
        },
        {
          "text": "Adherencia Medica",
          "items": [
            {
              "text": "Get Medicaments",
              "link": "/doc/adherencia-medica/getAll"
            },
            {
              "text": "Get Diseases",
              "link": "/doc/adherencia-medica/getById"
            }
          ]
        },
        {
          "text": "Routes",
          "items": [
            {
              "text": "Get All Routes",
              "link": "/doc/routes/getAll"
            },
            {
              "text": "Get By Id",
              "link": "/doc/routes/getById"
            },
            {
              "text": "Add",
              "items": [
                {
                  "text": "Add Route",
                  "link": "/doc/routes/addRoute"
                },
                {
                  "text": "Update Route",
                  "link": "/doc/routes/updateRoute"
                }
              ]
            }
          ]
        },
        {
          "text": "Utils",
          "items": [
            {
              "text": "Get utils",
              "items": [
                {
                  "text": "Get Country",
                  "link": "/doc/util/getCountry"
                },
                {
                  "text": "Get States",
                  "link": "/doc/util/getStates"
                },
                {
                  "text": "Get Cities",
                  "link": "/doc/util/get-cities"
                },
                {
                  "text": "Get Documents types",
                  "link": "/doc/util/get-document-types"
                },
                {
                  "text": "Get Pone Codes",
                  "link": "/doc/util/get-pone-codes"
                },
                {
                  "text": "Get Eps",
                  "link": "/doc/util/get-eps"
                },
                {
                  "text": "Get Account Types",
                  "link": "/doc/util/get-account-types"
                }
              ]
            },
            {
              "text": "Post utils",
              "items": [
                {
                  "text": "Check Email and Phone",
                  "link": "/doc/util/check-email-adn-phone"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "socialLinks": [
    {
      "icon": "github",
      "link": "https://github.com/ameApp/ame-back"
    }
  ]
}

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.

Released under the MIT License.