npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@altazion/commerce-sdk-core

v26.415.7675

Published

Altazion Commerce SDK — Core client (fetch natif, cache SharedWorker, offline queue)

Readme

@altazion/commerce-sdk-core

Client HTTP universel pour l'API Altazion Commerce. Fonctionne dans tous les environnements JavaScript (navigateur, Node.js, SSR) sans dépendances tierces — uniquement fetch natif.

Installation

npm install @altazion/commerce-sdk-core

Utilisation rapide

import { CommerceClient } from '@altazion/commerce-sdk-core'

const client = new CommerceClient({
  baseUrl: 'https://votre-api.altazion.com',
  siteUrl: 'https://votre-site.com',
})

// Récupérer la session courante
const session = await client.session.getSession()

// Récupérer le panier
const cart = await client.cart.getCart()

// Rechercher des produits
const results = await client.catalog.search({ q: 'chaussures', offset: 0, length: 20 })

Modules disponibles

| Module | Description | |---|---| | client.session | Session utilisateur / kiosque | | client.cart | Panier (ajout, modification, suppression, coupons) | | client.catalog | Produits, catégories, recherche, suggestions | | client.shipping | Modes de livraison, points relais | | client.stores | Magasins physiques et horaires | | client.marketing | Contenus marketing personnalisés |

Fonctionnalités

  • Cache SharedWorker + IndexedDB — mise en cache des réponses, stratègies configurables (cache-first, network-first, network-only)
  • ConnectivityManager — détection de connectivité en temps réel avec API d'abonnement
  • Dual session — bascule automatiquement en mode kiosque si le user-agent est Altazion Device Shell
  • TypeScript — types complets générés depuis la spécification OpenAPI

Options de configuration

const client = new CommerceClient({
  baseUrl: 'https://votre-api.altazion.com', // obligatoire
  siteUrl: 'https://votre-site.com',          // URL canonique du site
  defaultCacheStrategy: 'cache-first',        // stratégie de cache par défaut
})

Mode CDN (sans bundler)

<script src="https://cdn.jsdelivr.net/npm/@altazion/commerce-sdk-core/dist/index.iife.js"></script>
<script>
  const client = new AltazionCommerceCore.CommerceClient({
    baseUrl: 'https://votre-api.altazion.com'
  })
</script>

Gestion des erreurs

import { AltazionApiError, OfflineError } from '@altazion/commerce-sdk-core'

try {
  await client.cart.addItem('REF-001', 1)
} catch (err) {
  if (err instanceof OfflineError) {
    // Le terminal est hors ligne : les mutations sont refusées immédiatement
  } else if (err instanceof AltazionApiError) {
    console.error(err.status, err.problem)
  }
}

Licence

Propriétaire — © Altazion SAS. Tous droits réservés.