Gathering detailed insights and metrics for react-shopify-hooks
Gathering detailed insights and metrics for react-shopify-hooks
Gathering detailed insights and metrics for react-shopify-hooks
Gathering detailed insights and metrics for react-shopify-hooks
@shopify/react-hooks
A collection of primitive React hooks
@shopify/hydrogen-react
React components, hooks, and utilities for creating custom Shopify storefronts
@shopify/react-form
Manage React forms tersely and safely-typed with no magic using React hooks
@shopwp/hooks
React hooks library for ShopWP.
Collection of React hooks for interacting with the Shopify API
npm install react-shopify-hooks
Typescript
Module System
JavaScript (100%)
Total Downloads
2,831
Last Day
1
Last Week
3
Last Month
17
Last Year
261
12 Stars
48 Commits
3 Forks
2 Watchers
3 Branches
1 Contributors
Updated on Feb 19, 2024
Minified
Minified + Gzipped
Latest Version
0.3.2
Package Id
react-shopify-hooks@0.3.2
Unpacked Size
183.47 kB
Size
26.54 kB
File Count
14
Cumulative downloads
Total Downloads
1
24
Collection of React hooks for interacting with the Shopify API.
Planning. Work on implemtation.
1npm install --save react-shopify-hooks
ShopifyProvider
1<ShopifyProvider 2 shopName="your-shop-name" 3 storefrontAccessToken="your-access-token" 4> 5 {children} 6</ShopifyProvider>
Context provider for all Shopify hooks. Must be used at the root of your app.
useShopifyProduct
const { product, error } = useShopifyProduct(productId)
product
All product data for the provided product ID
error
Error message if fetching product data failed
useShopifyProductVariant
const { productVariant, error } = useShopifyProductVariant(productId, productVariantId)
Fetches product variant data. Note that the parent product's ID is necessary.
productVariant
All product variant data for the provided product variant ID
error
Error message if fetching product variant data failed
useShopifyCustomerAccessToken
const { create, renew, delete } = useShopifyCustomerAccessToken()
Manages customer access token creation, renewal, and deletion.
Object with the following properties.
create(email, password)
Create a new customer access token. Returns the token.
renew(customerAccessToken)
Renew the customer access token. Returns the renewed token.
delete(customerAccessToken)
Permanently delete the customer access token.
useShopifyCheckout
const { checkout, actions, error } = useShopifyCheckout(checkoutId?)
Fetches a checkout using the provided checkout ID and provides actions for that checkout.
If no checkout ID is provided, all actions except createCheckout
will fail.
1const ApplyDiscountButton = ({ discountCode }) => { 2 const { 3 actions: { discountCodeApply }, 4 } = useShopifyCheckout(myCheckoutId) 5 6 return ( 7 <button onClick={() => discountCodeApply(discountCode)}> 8 Instant savings! 9 </button> 10 ) 11}
Object with the following properties.
checkout
All checkout data. Data updates on successful actions.
actions
Collection of functions related to the product variant
createCheckout()
Create a new checkout. Returns the checkout ID.
attributesUpdate(attributes)
Update the checkout attributes.
customerAssociate(customerAccessToken)
Associate the checkout to a customer.
customerDisassociate()
Disssociate the checkout from any customer.
discountCodeApply(code)
Apply a discount code to the checkout.
discountCodeRemove()
Remove any discount code from the checkout.
emailUpdate(email)
Update the checkout's email address.
giftCardsAppend(codes)
Append gift card codes to the checkout.
giftCardRemove(code)
Remove the gift card code from the checkout.
lineItemsReplace(lineItems)
Replace the checkout line items.
shippingAddressUpdate(address)
Update the checkout's shipping address.
shippingLineUpdate(handle)
Update the checkout's shipping line.
error
Error message if fetching checkout data failed.
useShopifyCustomer
const { customer, actions, error } = useShopifyCustomer(customerAccessToken?)
Fetches a customer using the provided customer access token and provides actions for that customer.
If no customer access token is provided, all actions except createCustomer
,
activateCustomer
, recoverCustomer
, resetCustomer
, and
resetCustomerByUrl
will fail.
customer
All customer data for the provided customer access token.
actions
Collection of functions related to the customer.
createCustomer(email, password)
Create a new customer.
activateCustomer(customerId, activationToken, password)
Activate a customer using the provided customer Id, activation token, and
password.
recoverCustomer(email)
Send a reset password email to the customer.
resetCustomer(resetToken, password)
Reset a customer's password with the provided reset token and password.
resetCustomerByUrl(resetUrl, password)
Reset a customer's password with the provided reset URL and password.
addressCreate(address)
Add an address to the customer.
addressDelete(addressId)
Delete a customer's address using the address ID.
addressUpdate(id, address)
Update a customer's address using the address ID.
addressDefaultAddressUpdate(addressId)
Set a default address for the customer.
updateCustomer(attributes)
Update a customer's attributes.
error
Error message if fetching customer data failed
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
89 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreLast Day
0%
1
Compared to previous day
Last Week
-62.5%
3
Compared to previous week
Last Month
-22.7%
17
Compared to previous month
Last Year
25.5%
261
Compared to previous year