Runable v1.0.0-alpha.20
Why Runable? Docs Modules Work with AI Blog About Changelog
  • 01Why Runable?
  • 02Docs
  • 03Modules
  • 04Work with AI
  • 05Blog
  • 06About
  • 07Changelog
Vue without a fixed server runtime.
Getting Started Structure Integrations Guide MCP API
  • Getting Started Structure Integrations Guide MCP API
Components
  • RunablePage
  • RunableLink
  • RunableLayout
  • ClientOnly
Composables
  • useAsyncData
  • useFetch
  • useConfig
  • useRuntime
  • useApp
  • useAppError
  • useRouter
  • useRoute
  • navigateTo
  • onBeforeRouteUpdate
  • injectHead
  • useHead
  • useSeoMeta
  • useHeadSafe
  • useSchemaOrg
Globals
  • $fetch
  • definePageMeta
  • defineVueMiddleware
  • defineVuePlugin
  • Vue APIs

useAsyncData

Load, cache, and hydrate asynchronous data during SSR.

function useAsyncData<Data, TransformedData = Data>(
  key: string,
  fetcher: (signal?: AbortSignal) => Promise<Data>,
  options?: AsyncDataOptions<Data, TransformedData>,
): AsyncDataResult<TransformedData, Error> & PromiseLike<AsyncDataResult<TransformedData, Error>>
const { data, pending, error, refresh } = await useAsyncData(
  "projects",
  async (signal) => {
    const response = await fetch("/api/projects", { signal });
    return response.json() as Promise<Project[]>;
  },
);

Options

OptionDefaultPurpose
servertrueAllows execution during SSR
lazyfalseDoes not wait for the result before completing the render
immediatetrueStarts the fetcher immediately
ttl300000Cache duration in milliseconds
default() => nullInitial value
transform—Transforms the result before caching it
watch—Re-runs the request when a source changes

The result exposes data, pending, error, status, execute(), and refresh(). The key is used for caching and deduplication: include every parameter that changes the resource.

Report an issue Edit this page
Composables

Reference for the auto-imported Runable, Vue Router, Unhead, and Schema.org composables.

useFetch

Fetch data with reactive options, SSR hydration, caching, and request deduplication.

On this page

  • 1Options
Runable

The Vue framework that brings productive conventions to any backend.

Product

  • Why Runable
  • Documentation
  • Installation
  • Integrations

Project

  • About
  • Blog
  • Changelog
  • Sponsor

Community

  • GitHub
  • Issues
  • Discussions
  • Bluesky

© 2026 Runable. Released under the MIT License.

Open source Built with Vue and Runable