Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
commerce-sdk-react-preview
Advanced tools
A library that provides react hooks for fetching data from Commerce Cloud
A library of React hooks for fetching data from Salesforce B2C Commerce.
The full documentation for PWA Kit and Managed Runtime is hosted on the Salesforce Developers portal.
To integration this library with your PWA-Kit application you can use the
CommerceApiProvider
directly given that you use thewithReactQuery
higher order component to wrap yourAppConfig
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)
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
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).
FAQs
A library that provides react hooks for fetching data from Commerce Cloud
The npm package commerce-sdk-react-preview receives a total of 22 weekly downloads. As such, commerce-sdk-react-preview popularity was classified as not popular.
We found that commerce-sdk-react-preview demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.