open-index/open-npm huggingface dataset:
npm package: @shoppexio/sdk
Description: Official JavaScript/TypeScript SDK for the Shoppex Developer API
Author: Shoppex
Latest version: 0.1.1

# @shoppexio/sdk

Official JavaScript/TypeScript SDK for the Shoppex Developer API.

This package wraps the `/dev/v1/*` API with a typed client surface for backend integrations, internal tools, and OAuth app installs.

## Install

```bash
npm install @shoppexio/sdk
```

## Quick start

```ts
import { ShoppexClient } from '@shoppexio/sdk';

const client = new ShoppexClient({
  apiKey: process.env.SHOPPEX_API_KEY!,
});

const me = await client.me.get();
const products = await client.products.list({ page: 1, limit: 20 });

for (const product of products.data) {
  console.log(product.uniqid ?? product.id, product.name);
}
```

There is also a runnable example in `examples/basic-usage.ts`.

## Auth

Use one of these:

- `apiKey` for your own server-to-server integrations
- `accessToken` for OAuth installs

## Included convenience services

- `me`
- `products`
- `orders`
- `customers`
- `payments`
- `invoices`
- `coupons`
- `webhooks`

This covers the main commerce and ops flows out of the box:

- product reads and writes
- order creation, completion, fulfillment, and refunds
- customer reads and writes
- payment and invoice workflows
- coupon validation and management
- webhook management and delivery logs

## Pagination helpers

Cursor-based resources expose `listAll()` and `iterateAll()` helpers.

```ts
const allProducts = await client.products.listAll({ limit: 100 });

for await (const order of client.orders.iterateAll({ limit: 100 })) {
  console.log(order);
}
```

For page-based webhook delivery logs:

```ts
const logs = await client.webhooks.listAllLogs({ page: 1, limit: 100 });
```

## Typed core models

For the most common resources, the SDK now defaults to typed shapes:

```ts
const orders = await client.orders.list({ limit: 20 });
console.log(orders.data[0].status);

const customers = await client.customers.list({ limit: 20 });
console.log(customers.data[0].email);

const payments = await client.payments.list({ limit: 20 });
console.log(payments.data[0].status);

const coupon = await client.coupons.get('coupon_123');
console.log(coupon.data.code);

const webhook = await client.webhooks.get('wh_123');
console.log(webhook.data.url);
```

## Error handling

```ts
import { ShoppexApiError } from '@shoppexio/sdk';

try {
  await client.products.get('missing-id');
} catch (error) {
  if (error instanceof ShoppexApiError) {
    console.error(error.status, error.code, error.docUrl);
    console.error(error.details);
  }
}
```

## Low-level access

If you need an endpoint that is not wrapped yet, use the typed raw client:

```ts
const response = await client.raw.GET('/dev/v1/me');
```

## Docs

- Developer API docs: [docs.shoppex.io/api-reference/introduction](https://docs.shoppex.io/api-reference/introduction)
- SDK docs: [docs.shoppex.io/api-reference/sdks](https://docs.shoppex.io/api-reference/sdks)
npm package: @shoppexio/storefront
Description: Official JavaScript storefront SDK for Shoppex
Author: Shoppex
Latest version: 0.1.1

# @shoppexio/storefront

Official JavaScript storefront SDK for Shoppex.

Use this package when you want to embed Shoppex products, cart behavior, and hosted checkout into a custom frontend.

## Good fit

Use this package for:

- product loading
- cart state
- checkout redirects
- storefront helpers

## Install

```bash
npm install @shoppexio/storefront
```

## Quick start

```ts
import shoppex from '@shoppexio/storefront';

shoppex.init('my-store');

const products = await shoppex.getProducts();
shoppex.addToCart(products.data?.[0]?.uniqid ?? '', 'default', 1);
await shoppex.checkout();
```

## Not this package

If you want the authenticated Developer API wrapper for backend integrations, use `@shoppexio/sdk`.

## Docs

- Storefront docs: [docs.shoppex.io/sdk/introduction](https://docs.shoppex.io/sdk/introduction)
- Installation: [docs.shoppex.io/sdk/installation](https://docs.shoppex.io/sdk/installation)