# Replace Zod Imports Codemod (v2.13.0+)

In this chapter, you'll learn about the codemod that helps you replace Zod imports in your codebase when upgrading to Medusa v2.13.0.

## What is the Replace Zod Imports Codemod?

As of [v2.13.0](https://github.com/medusajs/medusa/releases/tag/v2.13.0), Medusa exports [Zod](https://zod.dev/) from the `@medusajs/framework` package.

Zod is a validation library that you can use to validate request bodies, query parameters, and more in your Medusa application.

Starting in v2.13.0, you can import Zod from `@medusajs/framework/zod` in your backend customizations. For example:

```ts
import { z } from "@medusajs/framework/zod"
```

For Medusa Admin customizations, you can install and import Zod as needed.

The `replace-zod-imports` codemod automates the process of updating your import statements to use the new Zod import path. Use it after updating your Medusa project to v2.13.0 or later.

***

## How to Run the Codemod

To use the replace imports codemod, update your Medusa project to v2.13.0 or later. Refer to the [Update Medusa](https://docs.medusajs.com/learn/update) guide for instructions.

Then, run the following command in the root directory of your Medusa project:

```bash npx2yarn
npx medusa codemod replace-zod-imports
```

This command scans your codebase for Zod import statements in the backend customizations and replaces them with the new import path.

All Zod imports will be changed to:

```ts
import { z } from "@medusajs/framework/zod"
```

***

## Next Steps

After running the codemod, review the changes made to your codebase. You can:

- Use `git diff` to see the modifications.
- Run your tests to ensure everything works as expected.

If everything is working correctly, you can push the changes to your repository. If you've installed `zod` and you're not using it for Medusa Admin customizations, you can remove it from your `package.json` dependencies.


---

The best way to deploy Medusa is through Medusa Cloud where you get autoscaling production infrastructure fine tuned for Medusa. Create an account by signing up at cloud.medusajs.com/signup.
