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

@hubroeducation/ltijs

v5.9.8

Published

Easily turn your web application into a LTI 1.3 Learning Tool.

Downloads

319

Readme

@hubroeducation/ltijs Fork

This is a fork of the original [email protected] from Cvcosta. The main difference is a patch that makes serverless mode properly work when your LTIJS Express server is mounted in a dedicated subpath of your existing Web application (like: "/ltitool"). This is currently not working in the main LTIJS repository

This fork allows you to specify the path your LTIJS serverless installation is attached on, so the library will always be able to reference the correct complete URL in case of redirects.

Easily turn your web application into a LTI® 1.3 Learning Tool.

Ltijs is the first LTI Library to implement the new LTI® Advantage Dynamic Registration Service, now supported by Moodle 3.10. The Dynamic Registration Service turns the LTI Tool registration flow into a fast, completely automatic process.


Table of Contents


Introduction

The Learning Tools Interoperability (LTI®) protocol is a standard for integration of rich learning applications within educational environments. ref

This library implements a tool provider as an Express server, with preconfigured routes and methods that manage the LTI® 1.3 protocol for you. Making it fast and simple to create a working learning tool with access to every LTI® service, without having to worry about manually implementing any of the security and validation required to do so.


Feature roadmap

| Feature | Implementation | Documentation | | --------- | - | - | | Keyset endpoint support | ✔️ | ✔️ | | Deep Linking Service Class | ✔️ | ✔️ | | Grading Service Class | ✔️ | ✔️ | | Names and Roles Service Class | ✔️ | ✔️ | | Dynamic Registration Service | ✔️ | ✔️ | | Database plugins | ✔️ | ✔️ | | Revised usability tutorials | | | | Key Rotation | | | | Redis caching | | |


Installation

Installing the package

$ npm install ltijs

MongoDB

This package natively uses mongoDB by default to store and manage the server data, so you need to have it installed, see link below for further instructions.

Database Plugins

Ltijs can also be used with other databases through database plugins that use the same structure as the main database class.


Quick start

Setting up Ltijs

const path = require('path')

// Require Provider 
const lti = require('ltijs').Provider

// Setup provider
lti.setup('LTIKEY', // Key used to sign cookies and tokens
  { // Database configuration
    url: 'mongodb://localhost/database',
    connection: { user: 'user', pass: 'password' }
  },
  { // Options
    appRoute: '/', loginRoute: '/login', // Optionally, specify some of the reserved routes
    cookies: {
      secure: false, // Set secure to true if the testing platform is in a different domain and https is being used
      sameSite: '' // Set sameSite to 'None' if the testing platform is in a different domain and https is being used
    },
    devMode: true // Set DevMode to false if running in a production environment with https
  }
)

// Set lti launch callback
lti.onConnect((token, req, res) => {
  console.log(token)
  return res.send('It\'s alive!')
})

const setup = async () => {
  // Deploy server and open connection to the database
  await lti.deploy({ port: 3000 }) // Specifying port. Defaults to 3000

  // Register platform
  await lti.registerPlatform({
    url: 'https://platform.url',
    name: 'Platform Name',
    clientId: 'TOOLCLIENTID',
    authenticationEndpoint: 'https://platform.url/auth',
    accesstokenEndpoint: 'https://platform.url/token',
    authConfig: { method: 'JWK_SET', key: 'https://platform.url/keyset' }
  })
}

setup()

Implementation example


Documentation

See bellow for the complete documentation:

Ltijs Documentation

Service documentations:

Additional documentation:


Contributing

If you feel like it, you can donate any amount through paypal to the original author (Cvcosta) with a button below, it helps a lot.


Special thanks

A great THANK YOU to Cvcosta for the original implementation, that saved us a TONS of time/work in our project.


License

APACHE2 License

Learning Tools Interoperability® (LTI®) is a trademark of the IMS Global Learning Consortium, Inc. (https://www.imsglobal.org)