{
  "id": "81b6f5fa8412815129caa411",
  "source": "solid:signals",
  "type": "github-document",
  "title": "request-events",
  "content": "---\ntitle: Request events\nuse_cases: \u003e-\n  server context access, local data storage, request handling, server functions,\n  event access\ntags:\n  - events\n  - server\n  - context\n  - locals\n  - requests\n  - functions\nversion: '1.0'\ndescription: \u003e-\n  Access request events and local context in SolidStart server functions.\n  Type-safe locals and native event handling for server code.\n---\n\nRequest events in SolidStart are retrieved using the [`getRequestEvent`](/reference/server-utilities/get-request-event) from `@solidjs/web`.\nThese requests happen anywhere on the server.\n\n## Locals\n\nSolidStart uses `event.locals` to pass around a local context where needed.\n\nWhen adding fields to `event.locals`, the fields can be typed:\n\n```tsx title=\"global.d.ts\"\n/// \u003creference types=\"@solidjs/start/env\" /\u003e\ndeclare module App {\n  interface RequestEventLocals {\n    /**\n     * Declare your getRequestEvent().locals here\n     */\n  }\n}\n```\n\n## nativeEvent\n\nSometimes access is still needed to the underlying event from [Vinxi](https://vinxi.vercel.app/).\nThis can be accessed that using the `.nativeEvent` property, which is the underlying H3Event used, and can be passed to the helpers available in the ecosystem.\nNote that Vinxi HTTP helpers _do not_ treeshake so you can only import them in files that do not contain client or isomorphic code.\n\nMany of these events support Async Local Storage so this may not be needed.",
  "url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/solid-start/advanced/request-events.mdx",
  "metadata": {
    "path": "src/routes/solid-start/advanced/request-events.mdx",
    "repo": "solidjs/solid-docs",
    "repo_url": "https://github.com/solidjs/solid-docs.git",
    "size": 1414,
    "source_type": "github"
  },
  "hash": "22a93cf1f3dc151148224babed1a4e33a767fba952a4179a260107566f48a5d9",
  "timestamp": "2026-02-23T11:43:00.193619616+01:00"
}