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

@seniorsistemas/senior-platform-data

v5.4.1

Published

API para retornar valores dos usuários, atualmente retorna via cookies

Readme

senior-platform-data

API JavaScript para retornar valores dos usuários como token, url do serviço, dados do usuário, domínio, entre outros.

Dependências

  • NodeJS
  • NPM

Utilização da API

Para utilizá-la no local desejado basta fazer o import:

import { user } from "@seniorsistemas/senior-platform-data";

E após isso, chamar as funções, como por exemplo:

user.getToken().then(v => {console.log(v)});

Utilização da API IndexedDB para salvar as preferências dos usuários

Para utilizá-la no local desejado basta fazer o import:

import { preference } from "@seniorsistemas/senior-platform-data";

E após isso, chamar as funções, como por exemplo:

preference.setPreference({ username: 'username', value: {preference1: value, preference2: value...} }).then(r => {console.log(r)}).catch(e => {console.error(e)})

Todas as funções são assíncronas, tendo em mente que no futuro estas informações podem ser armazenadas em outro lugar ao invés de nos cookies.

Funções disponíveis

  • user

    • getAuthHeader() - Retorna o header de autorização para ser utilizado nas requisições
    • getToken() - Retorna o token de acesso
    • getUserData() - Retorna os dados do usuário
    • getRememberMe() - Retorna o token de atualização e o tempo de expiração (Funciona apenas para servicos executados no dominio senior.com.br)
  • service

    • getRestUrl() - Retorna a url do serviço mais o sufixo rest
    • getXServicesUrl() - Retorna a url da plataforma do projeto de flexibilização
    • getSoapUrl() - Retorna a url do serviço mais o sufixo soap (Funciona apenas para servicos executados no dominio senior.com.br)
    • getOdataUrl() - Retorna a url do serviço mais o sufixo odata (Funciona apenas para servicos executados no dominio senior.com.br)
  • utils

    • getDomain() - Retorna o domínio (Funciona apenas para servicos executados no dominio senior.com.br)
    • getSelectedSub() - Retorna o sub ativo (Funciona apenas para servicos executados no dominio senior.com.br)
    • getSelectedCompany() - Retorna a empresa ativa (Funciona apenas para servicos executados no dominio senior.com.br)
  • preference

    • setPreference() - Insere uma preferência do usuário no IndexedDB
    • getPrefence() - Retorna uma preferência do usuário

Integração para passagem credenciais na abertura de nova aba ou iframe

O componente carrega automaticamente o token, servicesUrl e xServicesUrl à partir dos parâmetros passados na abertura pelo menu.

FAQ

Estou recebendo erro no console com a seguinte mensagem: "It was not possible to retrieve the Senior Platform data. Try to get a token on initialization.". O que devo fazer para funcionar? Abaixo um exemplo para inicializar o token:

import { Injectable } from '@angular/core';
import { user } from "@seniorsistemas/senior-platform-data";
import { Observable, of } from 'rxjs';

@Injectable()
export class AppService {
  private token = null;
  constructor() {
    //Inicializa o token da propriedade corrente.
    user.getToken().then(data => this.token = data.token);
  }
  getUser(): Observable<any> {
    if(this.token) {
      return of(this.token);
    } else {
      throw new Error('Error getting token');
    }
  }
}