Getting Started
Core Concepts
Troubleshooting
Data Fetching Mutations let you retrieve data directly on the server, stream dynamic content seamlessly to users, and trigger secure data updates using Server Actions.
Server Actions are asynchronous functions executed on the server that can be called from client-side components to perform operations like saving data, updating databases, or handling form submissions. The framework handles the heavy lifting of securely encoding arguments, managing transport streams, and refreshing page data automatically once a mutation completes.
Before working with server actions and data fetching, it helps to understand a few core terms:
When a user triggers a Server Action from the browser, the system follows a clear lifecycle to securely execute the code and update the user interface:
POST request is dispatched to the server containing necessary router state headers and deployment tracking IDs.When configuring server actions and request bodies in your project settings, keep the default limits and behaviors in mind:
Note
If a Server Action payload exceeds the configured body size limit, the server will reject the request with a 413 Payload Too Large error.
Tip
Always ensure your server actions handle validation errors gracefully and return structured results so your client components can display helpful feedback to users.
Warning
Do not attempt to pass sensitive credentials or unencrypted secrets directly through client-exposed action arguments. Always access environment variables and secure databases entirely on the server side inside your action body.