Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.
This repository was archived by the owner on Oct 20, 2026. It is now read-only.

Modules for external providers #2

Closed

Description

@okbel

Modules for external providers

Right now, the code base is strictly coupled with data hooks providers. We need to enable the use of different providers interchangeably.

We’re discussing steps forward with @lfades to add different data sources to Next.js Commerce and make it super easy to switch data providers and even aggregate them.


Goals of Commerce

  • Next.js Commerce should have a completely data agnostic UI
  • Aware of schema: should ship with the right data schemas and types.
  • All providers should return the right data types and schemas to blend correctly with Next.js Commerce.
  • @framework will be the alias utilized in commerce and it will map to the ecommerce provider of preference- e.g BigCommerce, Shopify, Swell. All providers should expose the same standardized functions. Note that the same applies for recipes using a CMS + an ecommerce provider.

There is a framework folder in the root folder that will contain multiple ecommerce providers.

Additionally, we need to ensure feature parity (not all providers have e.g. wishlist) we will also have to build a feature API to disable/enable features in the UI.

Expected Structure

Main folder and its exposed functions

  • product

    • usePrice
    • useSearch
    • getProduct
    • getAllProducts
  • wishlist

    • useWishlist
    • addWishlistItem
    • removeWishlistItem
  • auth

    • useLogin
    • useLogout
    • useSignup
  • cart

    • useCart
    • useAddItem
    • useRemoveItem
    • useCartActions
    • useUpdateItem
  • config.json

  • README.md

Example of correct usage of Commece Framework

import { useUI } from '@components/ui'
import { useCustomer } from '@framework/customer'
import { useAddItem, useWishlist, useRemoveItem } from '@framework/wishlist'

Providers under development:

Providers help needed:

Activity

  1. added this to the v1 milestone on Oct 27, 2020
  2. pinned this issue on Oct 27, 2020
  3. leerob commented on Oct 28, 2020

    @leerob
    Contributor

    Another thought: Could we package the front-end somehow so existing Commerce users can get bug fixes pushed? This is tough because then they can't really customize their forked version.

    https://twitter.com/PrevostClemToun/status/1321387261511028743

  4. michaelbromley commented on Oct 28, 2020

    @michaelbromley
    Contributor

    @leerob my 2 cents: I think it is far preferable to package the project for distribution via npm. Relying on forking becomes utterly painful when big changes are made to the fork and upstream too, and then the user is left trying to merge and get it right - not a nice experience!

    Of course then there is the problem that an npm package is not a storefront. So there still needs to be some "scaffold" which consumes the npm package, and this scaffold part cannot be easily versioned. But if well-designed this can be kept to a minimal issue, since it is the core components in the npm package which will be changed more often.

    For example, how Angular does it with their CLI is pretty nice: the core libs are in npm packages, but some parts like your project package.json, angular.json, tsconfig.json and other parts are local to your repo. When upgrading they use an AST-based tool (schematics) to automatically apply codemods to your repo to keep it compatible with the latest package version. This may be overkill for this project, but I just give it as an example of what can be done.

  5. hoektoe commented on Oct 28, 2020

    @hoektoe

    Would be great to support shopify also like Gatsby but better since it's nextjs

  6. self-assigned this
    on Oct 28, 2020
  7. Clausinho commented on Oct 28, 2020

    @Clausinho

    I've seen a lot of support for shopify, but are there any plans for woocommerce or is it simply not economically viable?

  8. jerrylopez commented on Oct 29, 2020

    @jerrylopez

    I would love to work on a Magento provider. Is there other conversations happening outside of this issue regarding external providers?

  9. robbieaverill commented on Oct 29, 2020

    @robbieaverill

    I'm also keen to build in support for other eCommerce APIs. Two things are stopping me right now: 1) there's no license on this repository (edit: there is now: #95), 2) there's no checkout. Having an external checkout is pretty jarring from a UX perspective, and kind of antiquated in my opinion. The value of jamstack is having everything be headless and API driven in order to create efficient, optimised, and unique user experiences in the commerce space, which 50% of this project is not at time of writing.

    I imagine adding a checkout here would also involve building some additional UI components for it, and would involve coordination with the maintainers of this repository to ensure we get what we want. In the meantime, BigCommerce/Shopify/other eCommerce providers that have externally hosted checkouts seem to be the only option.

  10. agustif commented on Oct 30, 2020

    @agustif

    I'm also keen to build in support for other eCommerce APIs. Two things are stopping me right now: 1) there's no license on this repository, 2) there's no checkout. Having an external checkout is pretty jarring from a UX perspective, and kind of antiquated in my opinion. The value of jamstack is having everything be headless and API driven in order to create efficient, optimised, and unique user experiences in the commerce space, which 50% of this project is not.

    I imagine adding a checkout here would also involve building some additional UI components for it, and would involve coordination with the maintainers of this repository to ensure we get what we want. In the meantime, BigCommerce/Shopify/other eCommerce providers that have externally hosted checkouts seem to be the only option.

    Stripe Checkout is a nice hosted solution, there's already examples with next https://github.com/stripe-samples/nextjs-typescript-react-stripe-js

  11. martinbavio commented on Nov 4, 2020

    @martinbavio
    Contributor

    @robbieaverill started a RFC in order to talk about a fully custom checkout: #64

  12. patrys commented on Nov 5, 2020

    @patrys
    Contributor

    Very interested in this as well, I imagine an abstraction layer and a set of capability flags would make it easier to support other commerce backends without forcing everyone to implement the same common subset of features.

    Edit: I should make it clear that one of those features is a checkout API as opposed to a hosted checkout view.

  13. Quynh-Nguyen commented on Nov 24, 2020

    @Quynh-Nguyen

    @okbel
    Hi,
    Can you please share your branch you working on this issue?
    It's great if I can join to help for improve the implementation on it, because this is the most important feature.

  14. 32 remaining items

  15. added a commit that references this issue on Jun 14, 2021
  16. added a commit that references this issue on Oct 21, 2021
  17. added a commit that references this issue on Apr 24, 2023
  18. added 2 commits that reference this issue on May 11, 2023
  19. added a commit that references this issue on Jun 28, 2023
  20. added 2 commits that reference this issue on Apr 8, 2026
  21. added a commit that references this issue on May 14, 2026
  22. added 2 commits that reference this issue on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions