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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@globaling/client

v1.0.1

Published

Este módulo es un cliente HTTP diseñado para interactuar con el API de Globaling, permitiendo la autenticación y la realización de llamadas a diversas funciones del API de forma segura y eficiente.

Downloads

126

Readme

@globaling/client

Este módulo es un cliente HTTP diseñado para interactuar con el API de Globaling, permitiendo la autenticación y la realización de llamadas a diversas funciones del API de forma segura y eficiente.

Características

  • Autenticación automática con tenantId y tenantSecret.
  • Fácil de usar con promesas y async/await.
  • Utiliza node-fetch y form-data para manejar peticiones y carga de datos.

Instalación

Instala el paquete usando npm:

npm install @globaling/client

O usando yarn:

yarn add @globaling/client

Uso

Para usar esta librería, primero importa y crea una instancia de GlobalingClient con tus credenciales de autenticación.

const GlobalingClient = require('@globaling/client');

const client = new GlobalingClient('your-tenant-id', 'your-tenant-secret');

Realizar una llamada a una función

Puedes realizar llamadas a las funciones del API usando el método callFunction. Aquí tienes un ejemplo de cómo enviar datos a un endpoint específico:

async function sendData() {
  const data = { key: 'value' };
  try {
    const response = await client.callFunction('endpoint-name', data);
    console.log(response);  // Manipula la respuesta como necesites
  } catch (error) {
    console.error('Error al realizar la llamada:', error);
  }
}

sendData();

Métodos

constructor(tenantId, tenantSecret)

Crea una nueva instancia del cliente.

  • tenantId: String. El ID de tenant proporcionado para la autenticación.
  • tenantSecret: String. El secreto de tenant proporcionado para la autenticación.

async callFunction(endpoint, data)

Realiza una llamada POST al endpoint especificado con los datos proporcionados.

  • endpoint: String. El endpoint del API al que deseas llamar.
  • data: Object. Un objeto que contiene los datos que se enviarán en la solicitud.

Contribuciones

Las contribuciones son siempre bienvenidas. Si deseas contribuir a este proyecto, por favor, crea un fork del repositorio y envía un pull request.

Licencia

Este proyecto está licenciado bajo la Licencia MIT. Consulta el archivo LICENSE en este repositorio para más información.