Loyalty Module

In this section of the documentation, you will find resources to learn more about the Loyalty Module and how to use it in your application.

Note: The Loyalty Module is part of the Loyalty Plugin. It's compatible with Medusa v2.14.0+.
Looking for no-code docs? Refer to the Medusa Admin User Guide to learn how to manage gift cards using the dashboard.

Medusa has loyalty related features available through the Loyalty Module. A module is a standalone package that provides features for a single domain. Each of Medusa's commerce features are placed in Commerce Modules, such as this Loyalty Module.

Note: Learn more about why modules are isolated in this documentation.

Features#


How to Use the Loyalty Module#

1. Enable the Plugin#

The plugin is part of the MedusaGo repository. Import its package in the main.go file of your project to register it with the framework:

main.go
// Importing the package registers the plugin with the framework.
_ "github.com/hitkey-io/medusago/packages/plugins/loyalty/src"

Then add it to the Plugins of your configuration in medusa-config.go:

medusa-config.go
Plugins: []config.PluginConfig{
	{Resolve: "@medusajs/loyalty-plugin"},
},

2. Run Migrations#

Run the migrations to create the plugin's tables in the database:

Terminal
go run . db:migrate
Found a problem with this page?Report Issue
Edited Nov 14·Edit this page