Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
auth
✓ import { auth } from 'salesive-api-axios'
✗ const auth = require('salesive-api-axios').auth
Named export, ESM-only.
cart
✓ import { cart } from 'salesive-api-axios'
Named export for cart operations.
wishlist
✓ import { wishlist } from 'salesive-api-axios'
Named export for wishlist operations.
orders
✓ import { orders } from 'salesive-api-axios'
Named export for order operations.
coupon
✓ import { coupon } from 'salesive-api-axios'
Named export for coupon operations.
Demonstrates typical checkout flow: ghost account creation, cart/wishlist management, OTP authentication, order creation, and coupon application.
import { auth, cart, wishlist, orders, coupon } from 'salesive-api-axios';
async function checkout() {
// 1. Create a ghost customer and send OTP
await auth.createGhost();
// 2. Build the cart for the shopper before authentication
await cart.addItem({ productId: 'prod_123', quantity: 1 });
await cart.addItem({
productId: 'prod_456',
variantId: 'variant_blue',
quantity: 2,
});
// 3. Add items to wishlist for later
await wishlist.addItem({ productId: 'prod_789' });
// 4. Authenticate (trigger OTP flow; verify in your UI as needed)
await auth.checkUser({ email });
await auth.authenticate({ email, name, phone });
await auth.verify({ email, otp });
// 5. Convert the cart into an order once authentication succeeds
const { data } = await orders.createFromCart();
// 6. Optionally apply a coupon to the resulting order
await coupon.apply({ orderId: data?.data?.id, code: 'SUMMER20' });
return data;
}
Errors
Common errors & fixes
Module '"salesive-api-axios"' has no exported member 'auth'.
Importing from incorrect path or using default import.
fixUse `import { auth } from 'salesive-api-axios'`. Cannot read properties of undefined (reading 'data')
API call returned undefined without proper error handling.
fixWrap the call in try/catch and check response structure.
Missing SALESIVE_SHOP_ID or SALESIVE_API_KEY environment variable.
Required env vars not set.
fixSet VITE_SALESIVE_SHOP_ID / NEXT_PUBLIC_SALESIVE_API_KEY (or other supported prefix).
Audit
Dependencies
axiosrequiredHTTP client for API requests