Eden is a client-side package. Install it in your frontend project alongside a dev dependency on Elysia itself — Eden needs the Elysia types to infer your server’s schema.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/elysiajs/documentation/llms.txt
Use this file to discover all available pages before exploring further.
Install the package
The
elysia dev dependency must match the version running on your server. Eden uses it only for type inference — it is never bundled into your frontend.Export your server type
Add a singleexport type line to your Elysia server file. This is the only change required on the server side.
Connect from the client
Import the exported type and pass it as a generic totreaty. TypeScript will infer every route, parameter type, and response type automatically.
Troubleshooting
If Eden isn’t picking up types correctly, work through these common causes in order.Enable strict mode in tsconfig.json
Enable strict mode in tsconfig.json
Eden’s type inference requires TypeScript strict mode. Make sure your
tsconfig.json includes:Mismatched Elysia version
Mismatched Elysia version
Both your frontend and server must use the same Elysia version. Check with:The output should show a single Elysia version at the top level. If you see multiple versions, align them in your
package.json.TypeScript version too old
TypeScript version too old
Eden uses TypeScript features like const generics and template literal types. You need TypeScript >= 5.0 on your client.
Server not using method chaining
Server not using method chaining
Elysia builds up its type incrementally through method chaining. Each method returns a new typed instance. If you break the chain, the types won’t propagate.
Using Bun-specific APIs in responses
Using Bun-specific APIs in responses
If your handlers return Bun-specific types like
Bun.file, install @types/bun as a dev dependency on the client too:Path aliases in a monorepo
Path aliases in a monorepo
If your server uses TypeScript path aliases (e.g. Then import the server type using the same alias:
@/controllers), your frontend’s tsconfig.json must be able to resolve those same paths. Otherwise Eden will infer any.Configure your root tsconfig.json to map each package with a namespace prefix: