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

tray-login

v2.0.1

Published

Web Component para realizar login nas lojas da Tray.

Readme

Tray Login Component

Web Component para realizar login nas lojas da Tray.

Instalação

npm install tray-login

Atributos

Atributo | Descrição -------- | ----------- data-store | ID da loja data-methods | Tipos de login que você deseja utilizar, opções: ['facebook', 'password', 'otp'] data-callback | URL de callback caso o login esteja correto data-texts | Textos personalizados (opcional) data-identification | Identificação utilizada para login (opcional)

Eventos

Lista de eventos disparados pelo componente.

Evento | Descrição -------- | ----------- tray-login | Dispara quando finalizou o processo de login tray-login#close | Dispara quando fecha o componente tray-login#identify | Dispara quando abre a tela de identificação tray-login#main | Dispara quando abre a tela de login tray-login#otp | Dispara quando abre a tela de login com OTP tray-login#recover-password | Dispara quando abre a tela de recuperação de senha

Uso

1 - Adicione a bibilioteca vue e importe o componente no <head>:

<script src="https://unpkg.com/vue"></script>
<script src="dist/tray-login.min.js"></script>

2 - Adicione o elemento no seu HTML substituindo as URLs da aplicação.

<tray-login
    data-methods="['facebook']"
    data-callback="/callback.html"
    data-store="351572"
    data-texts="{}">
</tray-login>

Exemplo de utilização do evento:

$(window).on('tray-login', function(event) {
    var response = event.originalEvent.detail.response;
    var type = event.originalEvent.detail.type;
    if (type === 'success') {
        console.log('Success!');
    } else {
        console.error('Error!');
    }
});

$(window).on('tray-login#close', function() {
    console.log('Closed!');
});

Mudamos a forma como recuperamos os parâmetros do evento:

$(window).on('tray-login', function(event) {
    var response = event.detail.response;
    var type = event.detail.type;

    if (type === 'success') {
        console.log('Success!');
    } else {
        console.error('Error!');
    }
});

Contribuindo

Caso você possua o docker instalado juntamente com o docker-compose, execute o comando abaixo para levantar o container.

docker-compose up -d

Utilizando o comando abaixo é possível entrar no container para configurar as dependencias.

docker-compose exec tray_login bash

Para configurar o ambiente de dev, execute:

yarn

Agora que o ambiente está configurado, execute na raiz:

yarn serve

Caso você esteja utilizando o docker o comando acima já é executado automaticamente ao levantar o ontainer