Skip to main content
Mastra v1 is coming in January 2026. Get ahead by starting new projects with the beta or upgrade your existing project today.

Mastra.setStorage()

The .setStorage() method is used to set the storage instance for the Mastra instance. This method accepts a single MastraStorage parameter.

Usage exampleDirect link to Usage example

mastra.setStorage(
new LibSQLStore({
url: ":memory:",
}),
);

ParametersDirect link to Parameters

storage:

MastraStorage
The storage instance to set for the Mastra instance.

ReturnsDirect link to Returns

This method does not return a value.

On this page