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

@jussef/lms-sdk

v2.0.4

Published

SDK React para lms-api — hooks + componente ScormPlayer. Sin Firebase.

Readme

@jussef/lms-sdk

SDK React para integrar cualquier app con el sistema LMS centralizado. Proporciona hooks y un componente listo para reproducir cursos SCORM.


Instalacion

npm install @jussef/lms-sdk
# o
yarn add @jussef/lms-sdk

Peer dependencies requeridas:

npm install react react-dom

Inicio rapido

1. Envolver la app con LMSProvider

import { LMSProvider } from '@jussef/lms-sdk';

// token lo obtienes con useAuth (ver abajo)
<LMSProvider
  apiUrl="https://lms-api.tudominio.com"
  playerUrl="https://player.tudominio.com"
  token={token}
  tenantId="nombre-de-tu-tenant"
>
  <App />
</LMSProvider>

2. Login

useAuth funciona fuera del provider porque aun no tienes token.

import { useAuth } from '@jussef/lms-sdk';

function LoginScreen({ onLogin }) {
  const { login, loading, error } = useAuth('https://lms-api.tudominio.com');

  const handleSubmit = async (e) => {
    e.preventDefault();
    const { token, user } = await login({
      email: '[email protected]',
      password: '123456',
      tenantId: 'nombre-de-tu-tenant',
    });
    onLogin(token, user);
  };

  return (
    <form onSubmit={handleSubmit}>
      {/* tus inputs */}
      {error && <p>{error}</p>}
    </form>
  );
}

3. Reproducir un curso SCORM

import { ScormPlayer } from '@jussef/lms-sdk';

<ScormPlayer
  courseId="id-del-curso"
  userId="id-del-usuario"
  style={{ width: '100%', height: '100vh' }}
  onComplete={(data) => console.log('Completado', data)}
  onProgress={(data) => console.log('Progreso', data.status, data.score)}
  onExit={() => console.log('Salio del curso')}
/>

Hooks disponibles

useCourses

Gestiona los cursos del tenant.

import { useCourses } from '@jussef/lms-sdk';

function MisCursos() {
  const { courses, loading, upload, assign, remove } = useCourses();

  // Subir un .zip SCORM
  const handleFile = async (e) => {
    const course = await upload(e.target.files[0], 'Nombre del curso');
    console.log('Subido:', course);
  };

  // Asignar curso a un grupo
  await assign({ courseId: 'abc', groupId: 'grupo1' });

  // Asignar curso a un usuario especifico
  await assign({ courseId: 'abc', userId: 'user1' });

  // Eliminar curso
  await remove('id-del-curso');

  if (loading) return <p>Cargando...</p>;
  return courses.map(c => <div key={c.id}>{c.name}</div>);
}

useUsers

import { useUsers } from '@jussef/lms-sdk';

const { users, loading, createUser, createBulk, updateUser, deleteUser } = useUsers();

// Crear un usuario
await createUser({ email: '[email protected]', password: '123456', role: 'student' });

// Crear varios a la vez (ej: importar CSV)
const results = await createBulk([
  { email: '[email protected]', password: '123456' },
  { email: '[email protected]', password: '123456' },
]);
console.log(results.created.length, 'creados');
console.log(results.errors);  // los que fallaron

// Actualizar
await updateUser('userId', { role: 'admin' });

// Eliminar
await deleteUser('userId');

useGroups

import { useGroups } from '@jussef/lms-sdk';

const { groups, createGroup, addUser, addCourse, deleteGroup } = useGroups();

const grupo = await createGroup('Grupo A');
await addUser(grupo.id, 'userId');
await addCourse(grupo.id, 'courseId');

useProgress

import { useProgress, useGroupReport, useCourseReport } from '@jussef/lms-sdk';

// Progreso de un usuario en un curso
const { progress } = useProgress('courseId', 'userId');
// progress = { status, score, location, data, updatedAt }

// Todos los progresos de un grupo
const { records } = useGroupReport('groupId');

// Todos los progresos de un curso
const { records } = useCourseReport('courseId');

Referencia de ScormPlayer

| Prop | Tipo | Requerido | Descripcion | |------|------|-----------|-------------| | courseId | string | Si | ID del curso en lms-api | | userId | string | Si | ID del usuario | | style | object | No | Estilos CSS del contenedor | | className | string | No | Clase CSS del contenedor | | onComplete | function | No | Llamado cuando el curso se completa | | onProgress | function | No | Llamado en cada commit de progreso SCORM | | onExit | function | No | Llamado al desmontar el componente |


Referencia de LMSProvider

| Prop | Tipo | Requerido | Descripcion | |------|------|-----------|-------------| | apiUrl | string | Si | URL de lms-api | | playerUrl | string | Si | URL de scorm-player | | token | string | Si | JWT obtenido con useAuth | | tenantId | string | Si | ID del tenant |


Arquitectura del sistema

App React (tu frontend)
  usa @jussef/lms-sdk
       │
       ├── REST calls ──► lms-api (puerto 3001)
       │                    guarda progreso, usuarios, cursos
       │
       └── iframe ────────► scorm-player (puerto 3002)
                              sirve archivos SCORM
                              inyecta API SCORM 1.2/2004
                              reporta progreso a lms-api

Compatibilidad

  • SCORM 1.2
  • SCORM 2004
  • React 18+
  • Node.js 18+ (para lms-api y scorm-player)