Logo Medusa Customers

Medusa Customers

Tổ chức
OrcaQubits
medusa-customers

Manage Medusa v2 customers — customer profiles, email and social authentication, customer groups, addresses, and account management. Use when working with customer data and auth.

Tổng quan

Nhà phát hànhOrcaQubits
Kho mãagentic-commerce-skills-plugins
Tên kỹ năngmedusa-customers
Sao
40
Bản fork
17
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được OrcaQubits công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Medusa Customers trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-customers
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins.git /tmp/agentic-commerce-skills-plugins
mkdir -p .claude/skills
cp -r /tmp/agentic-commerce-skills-plugins/medusa-commerce/skills/medusa-customers .claude/skills/medusa-customers
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Medusa Customers trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Medusa Customers ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Medusa Customers với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Medusa v2 Customer Management

Before writing code

Fetch live docs:

  1. Web-search site:docs.medusajs.com customer module for customer data model and service methods
  2. Web-search site:docs.medusajs.com auth module for authentication providers and flows
  3. Web-search site:docs.medusajs.com customer group for group management and pricing rules
  4. Fetch https://docs.medusajs.com/resources/references/customer and review the ICustomerModuleService interface
  5. Web-search medusajs v2 auth provider social login 2026 for latest authentication patterns

Customer Data Model

Entity Relationships

EntityRelationshipKey Fields
CustomerRootemail, first_name, last_name, phone, has_account, metadata
Addresses[]Customer → manyaddress fields, country_code, is_default_shipping/billing
CustomerGroups[]Customer ↔ manyMany-to-many group membership
Orders[]Customer → many (link)Via Order Module link

Key Fields

FieldTypeDescription
emailstringUnique identifier for the customer
has_accountbooleantrue for registered, false for guest
first_name / last_namestringCustomer name
phonestringPhone number
metadataJSONBCustom key-value data

Authentication Architecture

Medusa v2 separates customer identity from authentication via the Auth Module:

Auth Module
├── AuthIdentity
│   ├── provider_identities[] (emailpass, google, github...)
│   └── app_metadata (linked customer_id)
└── Auth Providers (built-in + custom)

Authentication Flow

Register/Login ──> Auth Module validates ──> JWT token
  ──> Token includes auth_identity_id ──> Linked to customer_id

Auth Provider Comparison

ProviderTypeConfiguration
emailpassBuilt-inNo external config needed
googleOAuth2Client ID + secret
githubOAuth2Client ID + secret
CustomExtensibleImplement AbstractAuthModuleProvider

Email + Password Flow

StepEndpointPurpose
Register/auth/customer/emailpass/registerCreate auth identity
Login/auth/customer/emailpassAuthenticate, get token
Create customer/store/customersCreate customer profile (with token)

Social Login Flow (OAuth2)

StepEndpointPurpose
Initiate/auth/customer/{provider}Get redirect URL
Callback/auth/customer/{provider}/callbackExchange code for token
Create/Link/store/customersCreate or link customer profile

Fetch live docs for OAuth2 callback handling, redirect URIs, and token exchange flow.

Customer Groups

FieldTypeDescription
namestringGroup name (e.g., "VIP", "Wholesale")
metadataJSONBCustom group data
customersrelationMany-to-many with customers

Use Cases

Use CaseMechanism
Group-specific pricingPrice List rules linked to customer groups
Conditional promotionsPromotion rules targeting customer groups
Access controlCustom middleware checking group membership

Key Service Methods

OperationMethod
Create groupcustomerModuleService.createCustomerGroups()
Add to groupcustomerModuleService.addCustomerToGroup()
Remove from groupcustomerModuleService.removeCustomerFromGroup()
List groupscustomerModuleService.listCustomerGroups()

Address Management

FieldRequiredNotes
first_name / last_nameYes
address_1YesStreet address
cityYes
country_codeYesISO 2-letter code
postal_codeConditionalRequired by country
is_default_shipping / is_default_billingNoDefault flags
WorkflowPurpose
createCustomerAddressesWorkflowAdd new address
updateCustomerAddressesWorkflowUpdate existing address
deleteCustomerAddressesWorkflowRemove address

Store API Routes

Route PatternMethodPurpose
/store/customersPOSTCreate customer profile
/store/customers/meGETRetrieve authenticated customer
/store/customers/mePOSTUpdate customer profile
/store/customers/me/addressesGET/POSTList/add addresses
/store/customers/me/addresses/:idPOST/DELETEUpdate/remove address

All /store/customers/me routes require a valid JWT in the Authorization header.

Admin API Routes

Route PatternMethodPurpose
/admin/customersGET/POSTList/create customers
/admin/customers/:idGET/POSTRetrieve/update customer
/admin/customer-groupsGET/POSTManage groups
/admin/customer-groups/:id/customersPOSTAdd customers to group

Fetch live docs for request body shapes and query parameters on each route.

Best Practices

Authentication

  • Use the Auth Module for all authentication -- never implement custom auth logic outside it
  • Support both emailpass and at least one OAuth2 provider for user convenience
  • Store provider-specific data in provider_identities, not in customer metadata
  • Always link auth identities to customer profiles via app_metadata.customer_id

Customer Data

  • Use has_account to distinguish registered customers from guest checkouts
  • Store loyalty points, preferences, and custom attributes in metadata
  • Use customer groups for segmentation -- avoid duplicating group logic in app code

Address Management

  • Validate addresses against country-specific requirements (postal code formats)
  • Set is_default_shipping and is_default_billing to streamline checkout

Security

  • Validate JWT tokens on every authenticated request
  • Scope Store API customer data to the authenticated customer only
  • Never expose customer lists or group memberships via the Store API

Fetch the Medusa v2 customer module and auth module documentation for exact service method signatures, auth provider configuration, and JWT handling before implementing.

Câu hỏi thường gặp

Kỹ năng AI Medusa Customers làm được gì?

Manage Medusa v2 customers — customer profiles, email and social authentication, customer groups, addresses, and account management. Use when working with customer data and auth.

Vì sao nên dùng Medusa Customers trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Medusa Customers là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Medusa Customers trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-customers. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Medusa Customers?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Medusa Customers với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Medusa Customers với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Medusa Customers có miễn phí không?

Có. Kỹ năng này được OrcaQubits phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇