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

@tellio-test/widget

v1.0.2

Published

Tellio Widget wrapper for React applications

Readme

Tellio React Widget

Componente oficial React para o Tellio — a forma mais simples de coletar feedbacks, reportar bugs, NPS e rastrear page views na sua aplicação React/Next.js.

Instalação

npm install @tellio-test/widget
# ou
yarn add @tellio-test/widget
# ou
pnpm add @tellio-test/widget

Quick Start (Exemplo Mínimo)

Importe o widget no seu arquivo de layout principal (ex: src/app/layout.tsx no Next.js ou src/App.tsx no React). O ID do widget é obrigatório.

import { TellioWidget } from '@tellio-test/widget';

export default function RootLayout({ children }) {
  return (
    <html lang="pt-BR">
      <body>
        {children}
        <TellioWidget id="SEU_WIDGET_ID" />
      </body>
    </html>
  );
}

Com identificação de usuário

Passe o usuário logado via propriedade user para saber quem está enviando o feedback ou acessando as páginas:

import { TellioWidget } from '@tellio-test/widget';

export default function RootLayout({ children }) {
  // Exemplo de usuário logado (pode vir do seu provider de auth)
  const user = {
    id: "user_123", // Obrigatório se passar o objeto user
    email: "[email protected]", 
    name: "João Silva",
  };

  return (
    <html lang="pt-BR">
      <body>
        {children}
        <TellioWidget 
          id="SEU_WIDGET_ID"
          user={user}
        />
      </body>
    </html>
  );
}

Com rastreamento automático de page views

Ative trackPageViews={true} para registrar automaticamente cada tela que o usuário acessa.

import { TellioWidget } from '@tellio-test/widget';

export default function RootLayout({ children }) {
  return (
    <html lang="pt-BR">
      <body>
        {children}
        <TellioWidget 
          id="SEU_WIDGET_ID"
          user={{ id: "user_123", email: "[email protected]" }}
          trackPageViews={true}
        />
      </body>
    </html>
  );
}

Nota: O rastreamento automático detecta mudanças de rota em SPAs (Next.js, React Router, etc.) ouvindo eventos da History API.

Com rastreamento manual via hook

Se você preferir controle total em vez do rastreamento automático (trackPageViews), pode usar o hook usePageLogger. Exemplo com Next.js App Router usando usePathname():

'use client';

import { usePathname } from 'next/navigation';
import { usePageLogger } from '@tellio-test/widget';

export function PageTracker({ widgetId, userId }: { widgetId: string; userId?: string }) {
  const pathname = usePathname();

  usePageLogger({
    widgetId,
    customerId: userId,
    pathname,
  });

  return null;
}

Adicione <PageTracker /> no seu layout global (onde tem acesso ao client context).

Props do TellioWidget

| Prop | Tipo | Padrão | Descrição | |------|------|--------|-----------| | id | string | obrigatório | ID do seu widget. Encontrado no painel Tellio. | | user | TellioUser | undefined | Objeto do usuário logado: { id: string, email?: string, name?: string, phone?: string }. | | src | string | undefined | URL customizada do script do widget (para self-hosting). | | onLoad | () => void | undefined | Callback chamado quando o script do widget termina de carregar. | | trackPageViews | boolean | false | Se true, ativa o rastreamento automático de rotas (page views). | | apiUrl | string | https://app.tellio.br| URL base da API do Tellio para onde os page views serão enviados (útil para self-hosting ou ambiente de dev local). |

Parâmetros do usePageLogger

| Parâmetro | Tipo | Padrão | Descrição | |-----------|------|--------|-----------| | widgetId | string | obrigatório | ID do seu widget Tellio. | | pathname | string | obrigatório | Rota atual a ser registrada (ex: usar usePathname() no Next.js). | | customerId | string | undefined | ID do usuário logado para vinculação analítica. | | apiUrl | string | https://app.tellio.br | URL base da API do Tellio para onde chamadas HTTP serão enviadas. |

🛡️ Privacidade e LGPD / GDPR

O Tellio foi desenhado respeitando a privacidade dos usuários:

  • O rastreamento de page views é estritamente opt-in. Ele só envia dados se você habilitar explicitamente (trackPageViews={true} ou chamando o hook usePageLogger).
  • O controle dos dados enviados é 100% do desenvolvedor do projeto. O campo user.id ou customerId é um identificador opaco. Você não precisa enviar o ID real do banco (pode usar um hash ou identificador gerado) nem enviar e-mails aos envios de página.
  • Não existem cookies instalados pelo rastreamento de páginas para contornar ou monitorar o usuário em diferentes sessões na web. Tudo é gerenciado através de requisições independentes.

Criado com ❤️ pela equipe Tellio.