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-subdomain-tenancy

v2026.7.1

Published

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

Readme

@seedgrid/fe-subdomain-tenancy

npm version npm downloads TypeScript

Módulo front de multitenancy por subdomínio do SeedGrid: cada tenant vive no seu subdomínio (empresa.seudominio.com), com signup público que cria o tenant + usuário root. É a variante de tenancy por subdomínio — a variante por seleção de empresa no login fica no @seedgrid/fe-login-tenancy (variantGroup: "tenancy", use uma ou outra). Compõe sobre o motor de sessão do @seedgrid/fe-security.

Sumário

Funcionalidades

  • Signup de tenant — cria o tenant + usuário root num só fluxo, com validação de e-mail por código e reenvio.
  • Regras de subdomínio — helpers puros: normalizeSubdomain, validateSubdomain, isReservedSubdomain, getSubdomainValidationKey e a lista RESERVED_SUBDOMAINS — a mesma validação do backend, disponível pro feedback em tempo real no formulário.
  • Contexto de tenant no clientTenantProvider / useTenantContext (em @seedgrid/fe-subdomain-tenancy/client), registrado automaticamente como provider do app pelo CLI.

O pacote exporta:

  • SubdomainTenancyPaths — contrato dos endpoints públicos (/public/tenants, validate-email, resend-email).
  • DTOs client-safe do signup de tenant (tenant-signup) — conferidos contra o TenantSignupRequest.java real.
  • subdomain-rules (validação), TenantProvider (client) e createSubdomainTenancyServer (em /server, SERVER-ONLY, pra chamadas autenticadas pós-login).

Telas entregues pelo scaffold

| Tela | Rota | O que faz | | --- | --- | --- | | Signup de tenant | /signup (público) | Wizard completo de cadastro BR (CNPJ, endereço via ViaCEP, UF/cidade), escolha de subdomínio com validação em tempo real e confirmação de e-mail |

O scaffold também traz as rotas de apoio de localização (/api/locations/states, /api/locations/cities) e as server actions públicas do fluxo de signup (criação do tenant, validação de e-mail, reenvio de ativação) — tudo copiado pelo SeedGrid CLI via module.json (id: "subdomain-tenancy", requires: ["security"], variantGroup: "tenancy", provider TenantProvider registrado automaticamente).

Instalação

pnpm add @seedgrid/fe-subdomain-tenancy @seedgrid/fe-security @seedgrid/fe-core

Uso rápido

// Client: validação de subdomínio em tempo real
import { normalizeSubdomain, validateSubdomain } from "@seedgrid/fe-subdomain-tenancy";

const sub = normalizeSubdomain(input);           // "Minha Empresa!" -> "minha-empresa"
const erro = validateSubdomain(sub);             // null se ok; chave de erro se inválido/reservado
// Client: contexto do tenant corrente
import { TenantProvider, useTenantContext } from "@seedgrid/fe-subdomain-tenancy/client";

function Header() {
  const { tenant } = useTenantContext();
  return <span>{tenant?.name}</span>;
}

Backend correspondente

Extensão Quarkus seedgrid-quarkus-ext-subdomain-tenancy. SubdomainTenancyPaths é espelho do RestControllerPath.java da extensão; os DTOs de signup foram conferidos contra o TenantSignupRequest.java real.

Suporte

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

Licença

MIT