2.7.3-preview.3 • Published 11 months ago

commerce-sdk-react-preview v2.7.3-preview.3

Weekly downloads
-
License
See license in LI...
Repository
github
Last release
11 months ago

Commerce SDK React

A library of React hooks for fetching data from Salesforce B2C Commerce.

Documentation

The full documentation for PWA Kit and Managed Runtime is hosted on the Salesforce Developers portal.

PWA-Kit Integration

To integration this library with your PWA-Kit application you can use the CommerceApiProvider directly given that you use the withReactQuery higher order component to wrap your AppConfig component. Below is a snippet of how this is accomplished.

// app/components/_app-config/index.jsx

import {withReactQuery} from 'pwa-kit-react-sdk/ssr/universal/components/with-react-query'

const AppConfig = ({children}) => {
    return (
        <CommerceApiProvider {...commerceApiProviderProps}>
            {children}
        </CommerceApiProvider>
    )
} 

// Set configuration options for react query.
// NOTE: This configuration will be used both on the server-side and client-side.
const options = {
    queryClientConfig: {
        defaultOptions: {
            queries: {
                retry: false
            },
            mutations: {
                retry: false
            }
        }
    }
}

export default withReactQuery(AppConfig, options)

Generic Integration

You can use this library in any React application provided you bring your own QueryClient and QueryClientProvider. Below is a sample integration:

import {QueryClient, QueryClientConfig, QueryClientProvider} from '@tanstack/react-query'


const App = ({children}) => {
    const queryClient = new QueryClient(queryClientConfig)

    return (
        <QueryClientProvider client={queryClient}>
            <CommerceApiProvider {...commerceApiProviderProps}>
                {children}
            </CommerceApiProvider>
        </QueryClientProvider>
    )
} 

export default App

Useful Links:

Support Policy

Security patches are provided for 24 months after the general availability of each major version of the SDK (1.0, 2.0, and so on).

2.7.3-preview

11 months ago

2.7.3-preview.2

11 months ago

2.7.3-preview.3

11 months ago

2.7.2

11 months ago

2.7.2-preview.0

11 months ago

3.0.0-dev

11 months ago

2.7.1-alpha.0

12 months ago

2.7.1

12 months ago

2.8.0-preview.0

1 year ago

2.7.0-alpha.3

1 year ago

2.7.0-alpha.2

1 year ago

2.7.0-alpha.1

1 year ago

2.7.0-alpha.0

1 year ago

2.7.0

1 year ago

2.5.0

1 year ago

2.4.1

1 year ago

2.6.0

1 year ago

2.5.0-alpha.0

1 year ago

2.4.1-alpha.0

1 year ago

2.4.0

1 year ago

2.4.0-alpha.3

1 year ago

2.4.0-alpha.2

1 year ago

2.4.0-alpha.1

1 year ago