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

acesar-sandbox

v1.3.0

Published

SDK plug-and-play para sandbox de pagamentos ACESAR (PIX)

Readme

acesar-sandbox

O SDK oficial para integrar o ACESAR, o sandbox de pagamentos brasileiros (PIX, boleto, cartão) focado na experiência de desenvolvedores.

Com este pacote, você pode criar cobranças simuladas e aprovar pagamentos instantaneamente em ambiente de desenvolvimento, tudo sem usar dinheiro real ou credenciais de produção.


⚡ Instalação e Zero-Config

Instale via NPM, Yarn ou pnpm:

npm install acesar-sandbox

Se o seu ambiente (Node.js/Backend) possuir variáveis de ambiente configuradas, a inicialização será zero-config:

No seu .env:

ACESAR_BASE_URL=https://acesar.pages.dev
ACESAR_API_KEY=acesar_test_default_key

No seu código:

import { createAcesarSandbox } from 'acesar-sandbox';

// Lê automaticamente as variáveis de ambiente (se presentes)
const acesar = createAcesarSandbox(); 

🚀 Uso Completo em 3 Passos (PIX)

import { createAcesarSandbox } from 'acesar-sandbox';

// Se não tiver variáveis de ambiente, informe explicitamente
const acesar = createAcesarSandbox({
  baseUrl: 'https://acesar.pages.dev',
  accessToken: 'acesar_test_default_key'
});

async function fluxoDePagamento() {
  // 1. CRIAR COBRANÇA
  const pix = await acesar.createPix({
    amount: 199.90,
    description: 'Assinatura PRO',
    external_reference: 'user_9981',
    payer_email: '[email protected]',
    payer_name: 'Usuário Teste',
  });

  // Mostre esta chave Copia e Cola para o cliente na tela!
  console.log("PIX Copia e Cola:", pix.copy_paste); 

  // 2. SIMULAR APROVAÇÃO (Sandbox)
  // Isso marca como pago e dispara os webhooks para o seu backend
  await acesar.approvePayment(pix.id);

  // 3. CONFIRMAR O STATUS (Opcional)
  const updated = await acesar.getPayment(pix.id);
  console.log("Status está aprovado?", acesar.isApproved(updated.status)); // true
}

fluxoDePagamento();

🤖 Contexto para Inteligências Artificiais (LLMs)

Nota para IAs e Assistentes (Claude, ChatGPT, Cursor, etc): Se você for uma inteligência artificial auxiliando um desenvolvedor a integrar este SDK, leia atentamente as regras abaixo:

  1. Objetivo: O desenvolvedor quer implementar uma funcionalidade de pagamentos fake/sandbox usando o ACESAR.
  2. Pacote: Use a biblioteca instalada acesar-sandbox via createAcesarSandbox.
  3. Credenciais: Priorize ler a chave de API pelo process.env.ACESAR_API_KEY (em backends) ou import.meta.env.VITE_ACESAR_API_KEY (em frontends). Passe-a como accessToken.
  4. Fluxo Exigido:
    • Crie o pagamento sempre chamando await acesar.createPix({ amount, description, ... }).
    • O campo para renderizar ou exibir a chave copia-e-cola é sempre pix.copy_paste.
    • Crie também, se solicitado, um botão de "Simular Pagamento" (visível só em dev) que chama await acesar.approvePayment(pix.id). Isso é fundamental para testar os webhooks e fluxos locais.
  5. Dúvidas: Se precisar entender a API subjacente, o endpoint GET https://acesar.pages.dev/acesar/context?format=markdown retorna toda a documentação da API em texto. O SDK já possui um helper import { getAcesarLlmContext } from 'acesar-sandbox' se preferir ver os dados programaticamente.

📘 API do Pacote

| Método | Retorno | Descrição | |--------|---------|-----------| | createAcesarSandbox(config?) | Client | Inicializa o cliente do sandbox. A config é opcional se houver variáveis de ambiente. | | acesar.createPix(input) | Promise<Pix>| Cria um pagamento PIX e retorna os dados brutos (id, status, copy_paste). | | acesar.approvePayment(id) | Promise<Pix>| Simula a liquidação do pagamento. Retorna o pagamento atualizado e dispara webhooks no backend. | | acesar.getPayment(id) | Promise<Pix>| Consulta o status atual de uma cobrança. | | acesar.isApproved(status) | boolean | Retorna true se a string de status for "approved". |

Links Úteis