In this document, you'll learn about the options of the Integration Module. You can pass these options when you register the module as a plugin in .
The options are typed as , which exports. The table lists its properties:
The option is the passphrase the module derives its encryption key from. It encrypts every option marked (AES-256-GCM) before saving it, and decrypts those values back at runtime.
Set it when you register the module:
medusa-config.ts1module.exports = defineConfig({2 // ...3 plugins: [4 {5 resolve: "@gorgo/medusa-integration",6 options: {7 encryptionKey: process.env.INTEGRATION_ENCRYPTION_KEY,8 },9 },10 ],11})
The value can be any non-empty string, though a high-entropy one is best for production, for example the output of . The module derives the key once, the first time it's needed, and reuses it for every registered integration's fields from then on. Without , the module throws when it saves an integration that has at least one option. Reading asks for the key only when a stored value has to be decrypted.
The module throws a of type whose message starts with . Medusa's error handler keeps the message for this error type, so an Admin API route answers with the message in the response body, and the Admin shows it in the notification about the failed save.
Keep the same on every Medusa process, server and worker alike, and for as long as integrations store secrets. The module can't decrypt a value encrypted with another key, so after a change, reading such an integration's options fails, and so do its page and the integrations list in the Admin. The module throws a of type , and an Admin API route answers with its message, Restore the previous key to bring them back. If it's lost, delete the affected integrations through , which doesn't decrypt secrets and so works without the right key, and configure them again.
Reading fails the same way when a stored secret is in a format version the installed module doesn't know, for example one written by a newer version of . The message is then
The option is an array of Integration Module providers.
When the Medusa application starts, these providers are registered under the Integration Module and their options become configurable in the Admin.
For example:
medusa-config.ts1module.exports = defineConfig({2 // ...3 plugins: [4 {5 resolve: "@gorgo/medusa-integration",6 options: {7 providers: [8 {9 resolve: "@gorgo/medusa-payment-my/providers/integration-my",10 id: "my-1",11 options: {},12 },13 ],14 },15 },16 ],17})
The option is an array of objects that accept the following properties:
The option is the project key from the Gorgo dashboard. The module checks the license of every installed paid Gorgo integration against it, in the background after startup and then once a day. A free integration is never checked, and without a paid integration installed the module never contacts the license service.
Without the option, the module reads the key from the environment variable, so most projects only set the variable:
.envGORGO_LICENSE=gorgo_live_...
The check never blocks the server from starting. Its result shows next to each paid integration in the Admin.
The module runs the check in each process that loads it, so the server and the worker both need the key. When you use , set the variable in the environment of both. If the key is missing, or doesn't look like a project key (), the module sends no request to the license service, and the Admin shows License key not set or License key has the wrong format. If the license service can't be reached, the module asks again after about 15 minutes instead of waiting for the next daily check, and the Admin shows License not checked in the meantime.
Refer to Paid Plugin Licensing to learn how to get a key.