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

react-native-roble-api-database-rena

v0.1.3

Published

Paquete para React Native que facilita la comunicación con la plataforma Roble API. https://roble.openlab.uninorte.edu.co/

Downloads

10

Readme

📦 roble_api_database

Paquete para React Native que facilita la comunicación con la plataforma Roble API. https://roble.openlab.uninorte.edu.co/

Este paquete provee una capa ligera para autenticación y operaciones CRUD sobre las bases de datos expuestas por Roble, manteniendo una interfaz simple y adecuada para aplicaciones móviles y de escritorio con Flutter.

https://github.com/Arias3/roble_api_database

🚀 Instalación

Agrega la dependencia en tu proyecto Flutter:

npm install react-native-roble-api-database-rn

Importa el paquete donde lo necesites:

import { createRobleClient, RobleApiException } from 'react-native-roble-api-database-rn';

🧭 Quick start

Ejemplo mínimo de uso (async/await):

const db = useMemo(
    () =>
      createRobleClient({
        baseURL: 'https://roble-api.openlab.uninorte.edu.co',
        codeUrl: 'robleapidatabase_e13b5d56c6',
        authHeaders: { 'x-app': 'roble-mobile' },
        dataHeaders: { 'x-app': 'roble-mobile' },
      }),
    []
  );

// Registrar usuario
const createUser = async () => {
    try {
      setLoading(true);
      const email = `test_user_${Date.now()}@mail.com`;
      appendLog(`Creando usuario: ${email}`);

      const res = await db.register('Usuario Prueba', email, 'Password123!');
      setLastEmail(email);
      appendLog(`Usuario creado: ${res.email ?? email}`);
    } catch (e: any) {
      appendLog(`Error creando usuario: ${e?.message}`);
    } finally {
      setLoading(false);
    }
  };

// Iniciar sesión
fconst loginUser = async () => {
    if (!lastEmail) {
      appendLog('Primero crea un usuario antes de iniciar sesión.');
      return;
    }

    try {
      setLoading(true);
      appendLog(`Iniciando sesión con ${lastEmail}...`);
      const res = await db.login(lastEmail, 'Password123!');
      setAccessToken(res.accessToken);
      appendLog(`Sesión iniciada. Token: ${res.accessToken.substring(0, 25)}...`);
    } catch (e: any) {
      appendLog(`Error al iniciar sesión: ${e?.message}`);
    } finally {
      setLoading(false);
    }
  };

// Cerrar sesión
const logoutUser = async () => {
    if (!accessToken) {
      appendLog('No hay sesión activa para cerrar.');
      return;
    }

    try {
      setLoading(true);
      appendLog('Cerrando sesión...');
      await db.logout();   // sin argumentos
      setAccessToken(null);
      appendLog('Sesión cerrada correctamente.');
    } catch (e: any) {
      appendLog(`Error cerrando sesión: ${e?.message}`);
    } finally {
      setLoading(false);
    }
  };

// CRUD //
const testCrud = async () => {
    if (!accessToken) {
      appendLog('Debes iniciar sesión antes de probar CRUD.');
      return;
    }

    try {
      setLoading(true);
      appendLog('Creando registro...');
      const created = await db.create('usuarios_test', {
        nombre: 'Juan',
        rol: 'admin',
      });
      appendLog(`Registro creado: ${JSON.stringify(created)}`);

      appendLog('Leyendo registros...');
      const data = await db.read('usuarios_test');
      appendLog(`Se obtuvieron ${data.length} registros.`);

      appendLog('Actualizando registro...');
      const updated = await db.update('usuarios_test', created._id, {
        rol: 'editor',
      });
      appendLog(`Registro actualizado: ${JSON.stringify(updated)}`);

      appendLog('Eliminando registro...');
      const deleted = await db.delete('usuarios_test', created._id);
      appendLog(`Registro eliminado: ${JSON.stringify(deleted)}`);

      appendLog('CRUD completo.');
    } catch (e: any) {
      appendLog(`Error en CRUD: ${e?.message}`);
    } finally {
      setLoading(false);
    }
  };

---
## 🛠️ Contribuciones

Las contribuciones son bienvenidas. Si encuentras un bug o quieres proponer una mejora:


## Resumen

`roble_api_database` es un cliente ligero para Flutter que simplifica las peticiones HTTPS hacia la plataforma Roble. No abstrae la lógica de negocio del backend: su objetivo es facilitar el consumo de endpoints estandarizados (auth + CRUD) con manejo consistente de errores y facilidad para testing.

¡Las contribuciones y mejoras son muy bienvenidas! 🚀