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

livepix-sdk

v1.0.3

Published

O **LivePix SDK** permite uma integração fácil e eficiente com a API LivePix, oferecendo suporte para TypeScript e Node.js. Com ele, você pode gerenciar contas, pagamentos, transações, saldos e muito mais.

Readme

LivePix SDK

O LivePix SDK permite uma integração fácil e eficiente com a API LivePix, oferecendo suporte para TypeScript e Node.js. Com ele, você pode gerenciar contas, pagamentos, transações, saldos e muito mais.

📦 Instalação

Via npm

Instale o SDK usando npm:

npm install livepix-sdk

Via Yarn

Ou utilizando Yarn:

yarn add livepix-sdk

🚀 Como Usar

Importando o SDK

Para começar, importe a classe LivePix no seu código:

import LivePix from 'livepix-sdk';

Criando uma Instância do SDK

Antes de utilizar qualquer funcionalidade, crie uma instância do SDK com suas credenciais:

const clientId = 'seu-client-id';
const clientSecret = 'seu-client-secret';
const livePix = new LivePix(clientId, clientSecret);

🔹 Funcionalidades

📌 Obtendo Informações da Conta

Para acessar os dados da conta associada ao seu token:

const accountData = await livePix.account.getAccount();
console.log(accountData);

Exemplo de resposta:

{
  "id": "12345",
  "email": "[email protected]",
  "username": "usuario",
  "displayName": "Usuário Exemplo",
  "avatar": "https://example.com/avatar.png"
}

💰 Criando um Pagamento

Para gerar um pagamento, informe:

  • amount: Valor em centavos.
  • currency: Moeda (ex: BRL).
  • redirectUrl: URL de redirecionamento após o pagamento.
const payment = await livePix.payments.createPayment(100, 'BRL', 'http://seusite.com/retorno');
console.log(payment);

Exemplo de resposta:

{
  "reference": "61021c7bdabe5e001225b65b",
  "redirectUrl": "https://checkout.livepix.gg/61021c7bdabe5e001225b65b"
}

📊 Obtendo Pagamentos

const payments = await livePix.payments.getPayments();
console.log(payments);

Exemplo de resposta:

{
  "id": "61021c7bdabe5e001225b65b",
  "proof": "E0000000020210727170449258921630",
  "reference": "foo",
  "amount": 1000,
  "currency": "BRL",
  "createdAt": "2021-01-01T00:00:00-03:00"
}

💵 Consultando Saldo da Carteira

const walletBalance = await livePix.wallet.getWalletBalance();
console.log(walletBalance);

Exemplo de resposta:

{
  "currency": "BRL",
  "balance": 1000,
  "balanceHeld": 0,
  "balancePending": 200
}

🔄 Obtendo Transações da Carteira

const transactions = await livePix.wallet.getWalletTransactions('BRL');
console.log(transactions);

Exemplo de resposta:

{
  "proof": "E0000000020210727170449258921630",
  "currency": "BRL",
  "amount": 100,
  "balance": 100,
  "timestamp": 1637626062
}

🔔 Criando um Webhook

Para receber notificações sobre eventos na API LivePix:

const webhook = await livePix.webhooks.createWebhook('http://seusite.com/webhook');
console.log(webhook);

🗑️ Deletando um Webhook

const status = await livePix.webhooks.deleteWebhook('id-do-webhook');
console.log(status);

📜 Listando Webhooks Cadastrados

const webhooks = await livePix.webhooks.getWebhooks();
console.log(webhooks);

Exemplo de resposta:

{
  "id": "61021c7bdabe5e001225b65b",
  "url": "https://example.com/webhook"
}

📖 Métodos Disponíveis

| Método | Descrição | |--------|-----------| | account.getAccount() | Retorna informações da conta | | payments.createPayment(amount, currency, redirectUrl) | Cria um pagamento | | payments.getPayments() | Retorna todos os pagamentos | | wallet.getWalletBalance() | Retorna o saldo da carteira | | wallet.getWalletTransactions(currency) | Obtém transações da carteira | | wallet.getWalletReceivables(currency) | Obtém contas a receber | | webhooks.getWebhooks() | Retorna os webhooks cadastrados | | webhooks.createWebhook(url) | Cria um novo webhook | | webhooks.deleteWebhook(webhookId) | Deleta um webhook |


ℹ️ Considerações

  • Certifique-se de configurar corretamente o clientId, clientSecret e scope para acessar os endpoints da API.
  • O SDK utiliza OAuth2 para autenticação e renova automaticamente os tokens expirados.
  • Para mais detalhes, consulte a documentação oficial da API LivePix.

📜 Licença

Este SDK é distribuído sob a Licença MIT.