Skip to main content
Version: 4.3

Using AsyncLocalStorage

By default, domain api use used in the RequestContext helper. Since v4.0.3, you can use the new AsyncLocalStorage too, if you are on up to date node version:

const storage = new AsyncLocalStorage<EntityManager>();
const orm = await MikroORM.init({
context: () => storage.getStore(),
// ...
app.use((req, res, next) => {, true), next);
Last updated on by Renovate Bot