The getPageContext() function allows you to access the pageContext object inside Vike hooks.
It's only useful if you're building a Vike extension and you want to implement a universal hook. If you aren't building a Vike extension, then you don't need to know about getPageContext().
For example:
It's the same object than the function data(pageContext) argument and the following is equivalent:
You may ask yourself what the purpose of getPageContext() is and, indeed, it's useless for Vike users. But, if you are implementing a Vike extension and you want to implement a universal hook, then getPageContext() is useful, see Example.
Universal Hooks
A universal hook is a component hook that also works inside Vike hooks such as API > useConfig().
Example
In order to make useConfig() a universal hook (see Universal Hooks), the useConfig() implementation uses getPageContext():