|
1
|
export const metadata = { |
|
2
|
title: `${pageNumber} Plugins`, |
|
3
|
} |
|
4
|
|
|
5
|
# {metadata.title} |
|
6
|
|
|
7
|
In this chapter, you'll learn what a plugin is in Medusa. |
|
8
|
|
|
9
|
<Note> |
|
10
|
|
|
11
|
Plugins are available starting from [Medusa v2.3.0](https://github.com/medusajs/medusa/releases/tag/v2.3.0). |
|
12
|
|
|
13
|
</Note> |
|
14
|
|
|
15
|
## What is a Plugin? |
|
16
|
|
|
17
|
A plugin is a package of reusable Medusa customizations that you can install in any Medusa application. The supported customizations are [Modules](../modules/page.mdx), [API Routes](../api-routes/page.mdx), [Workflows](../workflows/page.mdx), [Workflow Hooks](../workflows/workflow-hooks/page.mdx), [Links](../module-links/page.mdx), [Subscribers](../events-and-subscribers/page.mdx), [Scheduled Jobs](../scheduled-jobs/page.mdx), and [Admin Extensions](../admin/page.mdx). |
|
18
|
|
|
19
|
Plugins allow you to reuse your Medusa customizations across multiple projects or share them with the community. They can be published to npm and installed in any Medusa project. |
|
20
|
|
|
21
|
 |
|
22
|
|
|
23
|
<Note title="Tip"> |
|
24
|
|
|
25
|
Learn how to create a wishlist plugin in [this guide](!resources!/plugins/guides/wishlist). |
|
26
|
|
|
27
|
</Note> |
|
28
|
|
|
29
|
--- |
|
30
|
|
|
31
|
## Plugin vs Module |
|
32
|
|
|
33
|
A [module](../modules/page.mdx) is an isolated package related to a single domain or functionality, such as product reviews or integrating a Content Management System. A module can't access any resources in the Medusa application that are outside its codebase. |
|
34
|
|
|
35
|
A plugin, on the other hand, can contain multiple Medusa customizations, including modules. Your plugin can define a module, then build flows around it. |
|
36
|
|
|
37
|
For example, in a plugin, you can define a module that integrates a third-party service, then add a workflow that uses the module when a certain event occurs to sync data to that service. |
|
38
|
|
|
39
|
<Note title="Use a plugin if" type="success"> |
|
40
|
|
|
41
|
- You want to reuse your Medusa customizations across multiple projects. |
|
42
|
- You want to share your Medusa customizations with the community. |
|
43
|
|
|
44
|
</Note> |
|
45
|
|
|
46
|
<Note title="Don't use a plugin if" type="error"> |
|
47
|
|
|
48
|
- You want to build a custom feature related to a single domain or integrate a third-party service. Instead, use a [module](../modules/page.mdx). You can wrap that module in a plugin if it's used in other customizations, such as if it has a module link or it's used in a workflow. |
|
49
|
|
|
50
|
</Note> |
|
51
|
|
|
52
|
--- |
|
53
|
|
|
54
|
## How to Create a Plugin? |
|
55
|
|
|
56
|
The next chapter explains how you can create and publish a plugin. |