npm @medusajs/medusa 2.22.0
v2.22.0: Node.js 22 Required, Export Customers, Multiple Payment Accounts

4 hours ago

Highlights

Node.js v22.22.0 or Later Required

🚧 Breaking change

This change only affects projects running Node.js 20. Projects already on Node.js 22 are unaffected.

Node.js 20 has reached end-of-life and is no longer supported. Medusa now requires Node.js v22.22.0 or later. Update your runtime environment before upgrading to this release.

node --version  # must print v22.22.0 or higher

#17089
#17107


Configurable HTTP Query Params in Traced Spans

When instrumentation is enabled for HTTP requests, query parameters are now traced in the url.query property instead of the http.url property. Also, by default, only the values of the fields, expand, limit, offset, order, and with_deleted query parameters are displayed. Other values are traced as REDACTED.

You can configure this behavior by setting the http.allowedQueryParams option in the instrumentation settings:

export function register() {
  registerOtel({
    serviceName: "medusajs",
    exporter,
    instrument: {
      http: {
        // change allowed query param values
        allowedQueryParams: ["q", "limit", "offset"],
        // or to allow everything
        // allowedQueryParams: "*",
      },
      workflows: true,
      query: true,
      db: true,
      cache: true,
    },
  })
}

Export Customers

Admin users can now export customer data as a CSV file directly from the dashboard. The export is backed by a new workflow and step in @medusajs/core-flows, a new admin API endpoint, and a new admin.customers.export() method in the JS SDK.

#16142


Multiple Payment Accounts for Medusa Payments

Medusa Payments now supports multiple payment provider accounts within the same project. This makes it possible to configure separate payment accounts per region or sales channel without running multiple Medusa instances.

#17099

Features

  • feat(dashboard, core-flows, js-sdk, types, medusa): add export customers feature by @shahednasser in #16142
  • feat: Support multiple payment accounts for medusa payments by @sradevski in #17099
  • feat: Add missing events for price lists and few others needed to keep a product index up to date by @sradevski in #17067
  • feat(dashboard): add refund reason selector to balance settlement form by @vansh17June in #16669
  • feat(dashboard): allow removing tracking rows in the create shipment form by @AndyMik90 in #17154
  • feat(dashboard): add Iran provinces to country-states by @soroush2025 in #17199

Bugs

  • fix(medusa): stop exporting sensitive HTTP headers and redact URL query params in spans by @medusa-agents in #17361
  • fix(auth-emailpass,types): add requireActorAssociation option to refuse logins on unassociated actor types by @medusa-agents in #17347
  • fix: Correctly reindex id-based filters by @sradevski in #17354
  • fix(auth): update the provider identity matching the entity_id from auth providers by @medusa-agents in #17337
  • fix(docs): include imported MDX partials in agent markdown and mark override pages as human-only by @medusa-agents in #17335
  • fix(@medusajs/medusa): accept case-insensitive order directions and report single-query errors on POST /store/search by @medusa-agents in #17313
  • fix(loyalty-plugin): use one random byte per character in gift-card code generation to restore full entropy by @medusa-agents in #17315
  • fix(dashboard): Load additional pages in product organization comboboxes by @medusa-agents in #17309
  • fix(payment-stripe): don't fail deleting a payment session whose PaymentIntent already succeeded by @medusa-agents in #17307
  • fix(medusa): remove undefined allowed from admin customers export query config by @NicolasGorga in #17314
  • fix(workflows-sdk): don't compensate a completed workflow when event release fails by @medusa-os-bot in #17293
  • fix(workflows-sdk): resolve transform results that have a key property by @medusa-os-bot in #17282
  • fix(product): keep the selected variant id when updating variants and refuse an empty options map by @medusa-os-bot in #17274
  • fix(core-flows): respect item-level allow_backorder when converting a draft order or confirming an order edit by @medusa-os-bot in #17210
  • fix(order): return order item quantity and prices when selecting explicit item fields by @medusa-os-bot in #17209
  • fix(event-bus-redis): push kept events in chunks and preserve the TTL when partially clearing a large event group by @medusa-os-bot in #17208
  • fix(dashboard): remove stale Persian translation keys by @soroush2025 in #17197
  • fix(test-utils): remove the unused inApp option by @bhupinder759 in #17129
  • fix(payment,core-flows): let refunds be retried safely with an idempotency key by @shahednasser in #16964
  • fix: Allow replacing the transport for search by @sradevski in #17102
  • fix: Preserve all parts of provider ID, apply provider ID formatting everywhere by @sradevski in #17166
  • fix(types): type the status filter of product list params as an array of statuses by @shahednasser in #17155
  • fix(js-sdk): don't throw a ReferenceError when setLocale is called outside the browser by @sarmah-rup in #17157
  • fix(loyalty-plugin): make allowed gift card fields matcher more specific by @NicolasGorga in #17141
  • fix(product): detach option values from variants when their option is removed from the product by @shahednasser in #16925
  • fix(utils): aggregate non-Error promise rejections without crashing by @fadiroot in #17048
  • fix(medusa): report a failed migration script instead of exiting 0 by @gautamyash in #17035
  • fix(loyalty-plugin): correct transaction note for store credit debits by @Suryaprakash1657 in #17077
  • fix(dashboard): show collection update errors by @ankitbuilds99 in #17112
  • fix(dashboard): use display_name from API in regions table countries cell in #17060
  • fix(dashboard): use fields in region detail loader query key by @azzliang6 in #17084
  • fix(i18n): correct Czech plural forms for counts of 5 and above by @Stratkoss in #17083
  • fix(draft-order): guard customer lists against null entries by @Dextheking1 in #16985
  • fix(ui): keep the gap between date and time segments in every locale by @thomassarazin in #16794
  • fix: correct "seperate" typo in two places by @Dextheking1 in #17039

Documentation

Chores

Other Changes

New Contributors

Full Changelog: v2.21.2...v2.22.0

Don't miss a new medusa release

NewReleases is sending notifications on new releases.