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

@agrada_digital/pbm

v0.2.7

Published

A React component library to implement the PBM (Pharmacy Benefit Manager) model - Web Component for Vanilla JS

Readme

🚀 PBM Library

Uma biblioteca de componentes Web Component para implementar o modelo PBM (Pharmacy Benefit Manager) de forma simples e eficiente.

Totalmente self-contained com React, MUI e todas as dependências incluídas. Funciona com simples tags <script>.

GitHub package.json version


📦 Instalação

Basta adicionar uma tag script no seu HTML:

<!-- CSS da biblioteca -->
<link rel="stylesheet" href="https://unpkg.com/@agrada_digital/pbm/dist/vanilla.js">

<!-- Script único com tudo incluído (447 kB, 136 kB gzip) -->
<script src="https://unpkg.com/@agrada_digital/pbm/dist/vanilla.js"></script>

⚡ Quick Start

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://unpkg.com/@agrada_digital/pbm/dist/vanilla.js">
</head>
<body>
  <pbm-component
    tenant_id="seu_tenant_id"
    target_product='{"id":"123","name":"Medicamento","price":50}'
    is_authenticated_shopper="false"
  ></pbm-component>

  <script src="https://unpkg.com/@agrada_digital/pbm/dist/vanilla.js"></script>
</body>
</html>

🎯 Atributos do Web Component

| Atributo | Tipo | Descrição | |----------|------|-----------| | tenant_id | string | ID do tenant (obrigatório) | | target_product | JSON string | Produto alvo em formato JSON | | is_authenticated_shopper | "true" | "false" | Status de autenticação | | custom_login_url | string | URL customizada para login | | theme | JSON string | Configurações de tema (cores) |


💡 Exemplos de Uso

Exemplo Básico

<pbm-component
  tenant_id="agrada_001"
  target_product='{"id":"P001","name":"Medicamento X","price":50}'
></pbm-component>

<script src="https://unpkg.com/@agrada_digital/pbm/dist/vanilla.js"></script>

Com Tema Customizado

<pbm-component
  tenant_id="agrada_001"
  target_product='{"id":"P001","name":"Medicamento X"}'
  theme='{"primaryColor":"#FF5722","secondaryColor":"#2196F3"}'
></pbm-component>

<script src="https://unpkg.com/@agrada_digital/pbm/dist/vanilla.js"></script>

Com Interatividade via JavaScript

<pbm-component id="pbm"></pbm-component>

<script src="https://unpkg.com/@agrada_digital/pbm/dist/vanilla.js"></script>

<script>
  const pbm = document.getElementById('pbm');
  
  // Atualizar atributos
  pbm.setAttribute('tenant_id', 'agrada_001');
  pbm.setAttribute('target_product', JSON.stringify({
    id: 'P001',
    name: 'Medicamento X',
    price: 50
  }));
  
  // Ouvir mudanças
  window.pbm.subscribe((state) => {
    console.log('Benefício aplicado?', state.isApplied);
  });
</script>

🌍 CDN URLs

unpkg (recomendado)

https://unpkg.com/@agrada_digital/pbm@latest/dist/vanilla.js
https://unpkg.com/@agrada_digital/[email protected]/dist/vanilla.js

jsDelivr

https://cdn.jsdelivr.net/npm/@agrada_digital/pbm@latest/dist/vanilla.js
https://cdn.jsdelivr.net/npm/@agrada_digital/[email protected]/dist/vanilla.js

📊 O que está Incluído

  • ✅ React 19 + React DOM
  • ✅ MUI Components
  • ✅ Zustand (State Management)
  • ✅ Tailwind CSS
  • ✅ React Hook Form
  • ✅ Zod (Validação)
  • ✅ Lucide Icons
  • ✅ Todos os componentes da biblioteca

Tudo em um único arquivo: 447 kB (136 kB gzip)


🔗 Referências


📝 Licença

MIT is_authenticated_shopper={BOOLEAN} custom_login_url="/login"

🛠️ Tecnologias Utilizadas

| Tecnologia | Descrição | |----------------|----------------------------------------------| | React | Biblioteca principal para construção de UI | | Vite | Bundler ultrarrápido para desenvolvimento | | TypeScript | Tipagem estática moderna para JavaScript | | TailwindCSS | Framework CSS utilitário | | Jest | Testes unitários | | Storybook | Documentação e desenvolvimento de UI isolada | | PNPM | Gerenciador de pacotes leve e rápido |


🧑‍💻 Criado por

Inovação - Agrada Digital
Feito com ❤️ para transformar a experiência em benefícios farmacêuticos.