The context API is by default used for all pre-defined stores in sveltekit such as the $page.data.

It provides a mechanism for components to ‘talk’ to each other without passing around data and functions as props or dispatching events.


A store can be attached to the component tree with setContext and when you subscribe you receive it with getContext.