solidstart-request-events

Access request event data in SolidStart server functions via getRequestEvent and event.locals.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/vallafederico/solid-ai-rules --skill solidstart-request-events
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solidstart-request-events
Source: https://github.com/vallafederico/solid-ai-rules/tree/main/.claude/skills/solidstart-request-events
Command: npx skills add https://github.com/vallafederico/solid-ai-rules --skill solidstart-request-events

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies accessing and managing request-specific data and context within SolidStart server-side functions, ensuring type safety and efficient data flow.

Core Features & Use Cases

  • Access Server Context: Retrieve request details like URL and headers using getRequestEvent.
  • Typed Locals: Define and use type-safe context data (event.locals) across server functions via middleware.
  • Advanced Access: Utilize nativeEvent for direct access to the underlying Vinxi/H3 event object when necessary.
  • Use Case: Securely authenticate users by checking an Authorization header in middleware, storing the user object in event.locals, and then accessing it in a server route to fetch user-specific data.

Quick Start

Use the solidstart-request-events skill to get the current request URL and set a custom response header.

Frequently Asked Questions about solidstart-request-events

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I access request event data in SolidStart server functions?

To access request event data in SolidStart, use the getRequestEvent function to retrieve the current server context, including details like the request URL and headers within your server-side routes.

How do I share type-safe data across SolidStart server routes using middleware?

Share type-safe data in SolidStart by defining custom properties on event.locals within your middleware. This allows you to pass typed context, like authenticated user objects, securely to downstream server functions.

Can I access the underlying H3 event object directly in SolidStart?

Yes, you can access the underlying H3 event object directly in SolidStart by utilizing the nativeEvent function, which facilitates advanced scenarios like direct response manipulation and low-level request metadata logging.

What's the best way to implement server-side authentication in SolidStart?

Implement server-side authentication in SolidStart by intercepting requests in middleware to check the Authorization header, store the validated user object in event.locals, and access it later in your server route to fetch user-specific data.

Does SolidStart support setting custom response headers from server functions?

Yes, SolidStart supports setting custom response headers from server functions. You can retrieve the server context using getRequestEvent and manipulate the response headers directly for advanced control over your HTTP responses.

When should I use nativeEvent instead of getRequestEvent in SolidStart?

Use nativeEvent instead of getRequestEvent when you require direct access to the underlying Vinxi or H3 event object for advanced scenarios that go beyond basic server context retrieval, such as low-level response manipulation.