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

@zolve/yampi

v0.3.0

Published

Pacote de integração com a API da Yampi

Readme

Yampi API - JavaScript/TypeScript

Pacote de integração com a API da Yampi para JavaScript/TypeScript.

Instalação

npm i @zolve/yampi

Autenticação

A API da Yampi exige três credenciais (obtidas em Perfil → Credenciais de API no painel da loja):

  • Alias — identificador da loja, usado no path da URL.
  • User-Token — enviado no header User-Token.
  • User-Secret-Key — enviado no header User-Secret-Key.

A URL base da API é https://api.dooki.com.br/v2/{alias}.

Criação da conexão

import { Yampi } from '@zolve/yampi'

const yampi = new Yampi({
  alias: 'minha-loja',
  userToken: 'seu-user-token',
  userSecretKey: 'sua-user-secret-key'
})

Entidades disponíveis

| Acesso | Endpoint | Operações | | ----------------------- | ----------------------- | ------------------------------------ | | yampi.orders | /orders | get (lista), find (por id) | | yampi.catalogProducts | /catalog/products | get (lista), find (por id) | | yampi.catalogBundles | /catalog/bundles | get, find, create, update, delete | | yampi.pricingPromocodes | /pricing/promocodes | get (lista) |

Exemplos

Listar pedidos

const result = await yampi.orders.get({
  include: ['customer', 'items'],
  filters: { status_id: [1, 2] },
  limit: 50
})

Visualizar um pedido

const order = await yampi.orders.find({
  orderId: 123,
  include: ['items', 'transactions']
})

Listar e visualizar produtos

const products = await yampi.catalogProducts.get({
  include: ['skus', 'images'],
  filters: { active: 1 }
})

const product = await yampi.catalogProducts.find({
  productId: 42,
  include: ['skus', 'prices', 'images']
})

Kits (Bundles)

// Listar
await yampi.catalogBundles.get()

// Visualizar
await yampi.catalogBundles.find({ bundleId: 10 })

// Criar
await yampi.catalogBundles.create({
  name: 'Kit Verão',
  image_url: 'https://.../kit.jpg',
  active: true,
  modifiable: false,
  custom_shipping: false,
  shipping_type: 'fixed',
  shipping_price: 0,
  shipping_days: 0,
  items: [
    { sku_id: 1, price_type: 'sku', price: 0, discount: 0, quantity: 2 }
  ]
})

// Atualizar (PUT — substituição completa)
await yampi.catalogBundles.update({
  bundleId: 10,
  name: 'Kit Verão Atualizado',
  image_url: 'https://.../kit.jpg',
  items: [
    { sku_id: 1, price_type: 'sku', price: 0, discount: 0, quantity: 1 }
  ]
})

// Excluir
await yampi.catalogBundles.delete({ bundleId: 10 })

Listar cupons

const promocodes = await yampi.pricingPromocodes.get({
  filters: { status: true, expired: false },
  include: ['products']
})

Tratamento de erros

import { Yampi, YampiApiException, YampiInternalException } from '@zolve/yampi'

try {
  await yampi.orders.find({ orderId: 999 })
} catch (e) {
  if (e instanceof YampiApiException) {
    console.error(e.statusCode, e.response)
  } else if (e instanceof YampiInternalException) {
    console.error('Erro interno:', e.message)
  }
}

Build

npm run build