![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@loophq/onstore-sdk
Advanced tools
An SDK for easily getting started with the Loop Returns onstore API.
The easiest way to get started is to link it into your page via CDN and then use the global variable exposed to use the library.
<script src="https://unpkg.com/@loophq/onstore-sdk@latest/dist/loop-onstore-sdk.js"></script>
<script>
LoopOnstore.init();
</script>
If you have a build process in place you can install via npm or yarn and import and use it as you need.
npm i @loophq/onstore-sdk
import { init } from '@loophq/onstore-sdk';
init();
<script src="https://unpkg.com/@loophq/onstore-sdk@latest/dist/loop-onstore-sdk.js"></script>
<script>
LoopOnstore.init({
key: '1234567890',
attach: '#checkout-button'
});
</script>
...
<!-- sidecart -->
<button id="checkout-button">Check out</button>
There's a single method that must be called for Loop Onstore to work correctly. You must run init()
on any page you want this to be active on. We generally suggest putting this just above the </body>
tag in your theme.liquid
file.
You'll need to pass in an options object that contains several things--an API key with the cart scope enabled, and any elements you want to attach to. An API key can be gotten by contacting support, and you'll need to find a selector for any checkout buttons you have, either on the cart page or in your sidecart if you use one.
Loop Onstore SDK exposes methods you can use to easily integrate with the Loop onstore API. If you're using the CDN link, you'll access these using the global variable LoopOnstore
. If you're installing via package manager you can import the methods individually to use.
Initializes the Loop onstore. You'll want to run this on every page load.
LoopOnstore.init({
key: '1234567890',
attach: '.checkout-button'
});
Submit a list of variants to the Loop onstore API. If you pass in an array of variant ids, it will use that, otherwise it queries Shopify for the current cart and uses that to create a Loop cart. Once a Loop cart has been created, you'll be sent back to the Loop Returns app.
Sends you back to Loop. You must set the token you get from the Loop Onstore API when calling this if you want your user to have their cart when they return. The submit()
method calls this automatically as a part of that functionality.
This will send you into the onstore experience with fake data. You'll want to walk through the entire flow to make sure it works properly, but this is nice for testing that all of the functionality is attaching properly.
Toggle debug messages on and off, which will log to the console what's happening. Running the testMode method will enable this automatically.
Sets your Loop onstore api key. This is required to communicate with the Loop Onstore API.
Pass this a css selector for your checkout button and the SDK will call the submit method automatically when a user is in the onstore flow. See examples to see how this works.
We use SemVer for versioning.
Run npm i
to install dependencies.
To develop locally, run npm run dev
. This will spin up a webpack dev server with everything you need to get going.
Run npm run build
and the library will be built in production mode in /dist
.
This project is licensed under the MIT License.
FAQs
An SDK for integrating with loop returns on-store api
The npm package @loophq/onstore-sdk receives a total of 0 weekly downloads. As such, @loophq/onstore-sdk popularity was classified as not popular.
We found that @loophq/onstore-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.