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

@seedgrid/fe-billing-user

v2026.7.1

Published

[![npm version](https://img.shields.io/npm/v/%40seedgrid%2Ffe-billing-user)](https://www.npmjs.com/package/@seedgrid/fe-billing-user) [![npm downloads](https://img.shields.io/npm/dm/%40seedgrid%2Ffe-billing-user)](https://www.npmjs.com/package/@seedgrid/f

Readme

@seedgrid/fe-billing-user

npm version npm downloads TypeScript

Módulo front de billing do assinante do SeedGrid: a visão do usuário final sobre a própria assinatura — plano atual, uso do ciclo, checkout, troca de plano com prévia de rateio, cancelamento/reativação e faturas. A visão de backoffice (cadastro de planos) fica no @seedgrid/fe-billing-platform. Compõe sobre o motor de sessão do @seedgrid/fe-security.

Sumário

Funcionalidades

  • Assinatura corrente — plano, status e resumo de uso do ciclo (/me/subscription, /me/usage/summary); extrato detalhado de uso com permissão STATEMENT_READ.
  • Checkout — primeira assinatura via sessão de checkout do provedor de pagamento (redirect).
  • Troca de plano — com prévia do impacto (rateio) antes de confirmar; upgrade imediato, downgrade agendado pro fim do ciclo; troca agendada pode ser cancelada.
  • Cancelar / reativar — cancelamento agendado pro fim do ciclo vigente, reversível enquanto não efetivado.
  • Customer portal — sessão do portal do provedor pra gestão de meio de pagamento.
  • Faturas — prévia da próxima fatura (preço fixo + excedente acumulado) e histórico de cobranças.
  • i18n prontobillingUserMessages (en + pt-BR completos; es/fr/pt-PT com fallback).

O pacote exporta:

  • BillingUserPaths — contrato dos endpoints REST (/me/subscription, /me/plans, /me/usage/*, /me/billing/*) — conferido contra os resources reais do backend.
  • DTOs client-safe da assinatura, planos, uso e faturas.
  • billingUserMessages (i18n).
  • createBillingUserServer (em @seedgrid/fe-billing-user/server, SERVER-ONLY) — engine tipado sobre a sessão do fe-security; todas as capacidades do engine têm UI correspondente no scaffold.

Telas entregues pelo scaffold

| Tela | Rota | O que faz | | --- | --- | --- | | Visão geral | /billing | Plano atual, uso do ciclo, acesso ao portal; cancelar, reativar e cancelar troca agendada (com confirmação) | | Planos | /billing/plans | Catálogo assinável: sem assinatura → assinar (checkout); com assinatura → trocar, com diálogo de prévia do rateio | | Faturas | /billing/invoices | Próxima fatura (prévia) + histórico de cobranças do provedor |

O scaffold também traz as rotas-proxy de API (/api/billing/* — checkout, portal, change-plan, cancel, reactivate, invoices, upcoming etc.), o bootstrap de servidor (compondo createSecurityServer + createBillingUserServer com a mesma sessão/cookie do app) e o submenu Billing (useBillingUserAppShellSections), gated por BILLING_READ — tudo wireado pelo SeedGrid CLI via module.json (id: "billing-user", requires: ["security"]).

Instalação

pnpm add @seedgrid/fe-billing-user @seedgrid/fe-security @seedgrid/fe-core

Uso rápido

// server-only — compõe sobre a sessão do fe-security
import { createSecurityServer } from "@seedgrid/fe-security/server";
import { createBillingUserServer } from "@seedgrid/fe-billing-user/server";

const session = createSecurityServer({ /* ... */ });
export const billing = createBillingUserServer(session);

// Em uma rota/action:
const assinatura = await billing.getSubscription(); // pode ser null (sem assinatura)
const preview = await billing.getChangePreview("plan-pro");
await billing.changePlan({ planId: "plan-pro" }); // upgrade imediato / downgrade agendado

Backend correspondente

Resources do seedgrid-report-api: MeBillingResource, BillingCheckoutResource, SubscriptionResource, UsageResource, PlansCatalogResource. Os paths foram auditados contra os @Path reais do backend.

Suporte

  • Issues: https://github.com/SeedGrid/seedgrid-fe-components/issues
  • Repositório: https://github.com/SeedGrid/seedgrid-fe-components

Licença

MIT