Skip to content

feat: add useProducts hook (MDK-403)#72

Merged
NatElkins merged 17 commits into
mainfrom
mdk-403
Jan 15, 2026
Merged

feat: add useProducts hook (MDK-403)#72
NatElkins merged 17 commits into
mainfrom
mdk-403

Conversation

@NatElkins

@NatElkins NatElkins commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add useProducts hook for fetching organization products via API
  • Update @moneydevkit/lightning-js to 0.1.57

Depends on:

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a8f50b543c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/core/package.json Outdated
@NatElkins NatElkins force-pushed the mdk-403 branch 2 times, most recently from 8c2de1a to e0dc23b Compare January 13, 2026 19:10
@NatElkins

Copy link
Copy Markdown
Contributor Author

@codex Review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@NatElkins

Copy link
Copy Markdown
Contributor Author

@codex Review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Add listProducts action and clientListProducts client-side function
- Add list_products route handler with CSRF auth
- Create useProducts hook with loading/error states
- Export Product type and hook from @moneydevkit/nextjs
github-actions Bot and others added 3 commits January 14, 2026 15:12
Resolve dependency version conflicts:
- Keep @moneydevkit/api-contract ^0.1.14 (needed for useProducts feature)
- Update @moneydevkit/lightning-js to ^0.1.60 (from main)
@NatElkins

Copy link
Copy Markdown
Contributor Author

@codex Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad8a047b98

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/core/src/actions.ts Outdated
@NatElkins

Copy link
Copy Markdown
Contributor Author

@codex Review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

- Update packages/core to use prices?.[0] instead of price
- Align UnconfirmedCheckout.tsx with new schema
- Update all packages to api-contract ^0.1.16
Show purchased products as line items inside the View Details
collapsible section, with a separator before totals. Handles
FREE, CUSTOM, and FIXED price types in both USD and SAT.
Updated comment for clarity regarding AMOUNT type fields.
Comment thread packages/core/src/actions.ts Outdated

@martinsaposnic martinsaposnic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall. tiny change requested

Change CreateCheckoutParams from a loose interface with optional fields
to a discriminated union that enforces correct field combinations:

- AmountCheckoutParams: type: 'AMOUNT' with required amount field
- ProductsCheckoutParams: type: 'PRODUCTS' with required products array

This provides better TypeScript DX with autocomplete and prevents
invalid combinations like passing both amount and products.
@martinsaposnic

Copy link
Copy Markdown
Contributor

hmmm just realized this will won't be backwards compat, is there any way we can make it default to amount? if not, that's ok, but let's try to make it ergonomic

Comment thread examples/mdk-nextjs-demo/app/page.tsx

@martinsaposnic martinsaposnic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's update the READMEs before sending it

@NatElkins NatElkins merged commit 475bc8f into main Jan 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants