Skip to main content

Installation

Getting Started

To install stayte, go to your project folder and add the following line to your package.json file:

package.json
{
...
"trustedDependencies": [
"stayte"
],
}

And then run:

bun add stayte zod

Note: For now you need to install zod manually because stayte doesn't include it in its bundle and it's a requirement to use the library (in the future, stayte will be able to be used without zod)

Now you can use stayte in your project by importing it:

import { ... } from "stayte";

Next.js

If you are using next.js, a patch will be automatically applied to your project, you don't need to do anything. If you want to check the patch, you can find every patch here.

Statye actually only work in dynamic rendering mode, so if you are using static rendering, unexpected behavior will appear.

Note: Stayte is only available since next.js 14.2.13 and above. if you are using an older version, leave a message in the issues and I will try to update the patch.

warning

Sometimes, your package manager don't directly apply the patch, in this case, just run the command to install the dependencies and the patch will be applied automatically.