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

mk-sdk-git

v1.1.28

Published

SDK de tracking de e-commerce + try-on da MetaKosmos (core tracker, roda em todas as páginas)

Readme

mk-sdk

SDK de tracking de e-commerce + try-on da MetaKosmos. Um único <script> que roda em todas as páginas da loja: mede a jornada de compra (visita → produto → carrinho → compra) e injeta o botão de provador virtual de forma zero-touch.

Publicado no npm como mk-sdk-git e distribuído via CDN (jsDelivr / unpkg).

Instalação

Cole uma linha antes de </head>, em todas as páginas da loja:

<script src="https://cdn.jsdelivr.net/npm/mk-sdk-git@1/dist/mk-sdk.js"
        data-mk-project="SEU_PROJECT_ID"
        data-mk-product="mk-fashion"
        async></script>
  • data-mk-project — ID do projeto (obrigatório).
  • data-mk-product — produto MetaKosmos da página (mk-fashion, mk-beauty, mk-3d…). Opcional; default mk-fashion.
  • async — não bloqueia o carregamento da página.

Versão do CDN

| Forma | URL | Quando usar | |---|---|---| | Major fixo (recomendado) | …/mk-sdk-git@1/dist/mk-sdk.js | Pega o último 1.x.y automaticamente — recebe correções sem quebrar | | Versão exata | …/[email protected]/dist/mk-sdk.js | Trava numa versão específica (imutável) | | unpkg (alternativa) | https://unpkg.com/mk-sdk-git@1/dist/mk-sdk.js | Mesmo pacote, outro CDN |

Evite @latest em produção: cache fraco e risco de um release novo quebrar a loja sem aviso. Prefira o major fixo (@1).

Via bundler (opcional)

npm install mk-sdk-git

O SDK é um IIFE auto-executável feito pra <script>. Num bundler, importe e garanta que window.__MK = { projectId, product } esteja definido antes do import (não há tag <script> pra ler os data-*).

Configuração

Lida do <script> (data-mk-*) ou de window.__MK antes do boot:

| Campo | Origem | Default | |---|---|---| | projectId | data-mk-project / __MK.projectId | — (obrigatório) | | product | data-mk-product / __MK.product | mk-fashion | | collectorUrl | data-mk-collector / __MK.collectorUrl | api-collector.mk3dlabs.com | | apiUrl | __MK.apiUrl | mkfashion-new-api.mk3dlabs.com | | debug | data-mk-debug / ?mkdebug | false | | anchor | __MK.anchor | null (cai no CMS/heurística) |

API pública (window.mk)

mk.open({ projectId, identifier });   // abre o provador
mk.close();
mk.isAvailable(projectId, identifier);
mk.onReady(cb); mk.onAddToCart(cb); mk.onProductLoaded(cb); /* … */

Coleta

Eventos vão em batch (2s ou 20 eventos) para POST {collectorUrl}/v1/track com header X-MK-Project-Id. Dados pessoais (e-mail, CPF, telefone, etc.) são descartados antes do envio.

Build

npm install
npm run build         # gera dist/mk-sdk.js
npm run build:ext     # gera dist + copia pra extension/mk-sdk.js
npm run build:watch   # rebuild em watch

Extensão de QA

extension/ é uma extensão Chrome que injeta o mk-sdk em qualquer loja para validar a integração (tracking, detecção de plataforma/SKU, picker de posição do botão) sem a marca precisar instalar o script. Veja extension/README.md.

Diagnóstico

scripts/ tem sondas (probe-*.js, recon-loja.js) para inspecionar detecção de plataforma/SKU e fluxo de carrinho ao vivo numa loja.