Ltijs Sequelize Database Plugin is an official plugin for the LTI Advantage Complete Certified `ltijs` library, enabling it to persist LTI platform and deployment data using databases supported by Sequelize. It provides a robust, production-ready solution for managing LTI data with relational databases like MySQL, PostgreSQL, and MariaDB. The current stable version is 2.4.4, with releases often coinciding with new feature additions or compatibility updates for the core `ltijs` library, as seen with versions 2.4.0 and 2.3.0 introducing support for new `ltijs` features. This tight integration ensures seamless operation and access to advanced LTI features like Dynamic Registration Service and `authorizationServer` platform fields. Its primary differentiation is its certified compatibility and direct integration with `ltijs`, offering a tested and reliable database solution for LTI service providers.
npm install ltijs-sequelizeVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to initialize the `ltijs-sequelize` database plugin with specific Sequelize options (e.g., dialect, host) and integrate it with the `ltijs.Provider` instance, followed by deploying both the database schema and the LTI provider.
Always consult the `ltijs-sequelize` compatibility table in the README to ensure your `ltijs-sequelize` version matches your `ltijs` version (e.g., `ltijs-sequelize@^2.4.2` requires `ltijs@^5.7.0`). Update both packages concurrently if necessary.
Ensure your `Database` constructor call is structured like `new Database('db', 'user', 'pass', { host: 'localhost', dialect: 'mysql', ...otherOptions })`.Review `ltijs-sequelize` changelogs for schema updates before deploying new versions. Consider disabling automatic migrations or managing them manually in critical production systems if fine-grained control over schema changes is required (if the library offers a way to do so).
Set `cookies: { secure: true, sameSite: 'none' }` in your `lti.setup` configuration for production deployments. Use environment variables (e.g., `process.env.NODE_ENV === 'production'`) to conditionally enable `secure: true`.Install the appropriate database driver package (e.g., `npm install mysql2` for `mysql` or `mariadb` dialects, `npm install pg pg-hstore` for `postgres` dialect, `npm install tedious` for `mssql` dialect) alongside `sequelize` and `ltijs-sequelize`.
Verify your database server is running and configured to accept connections from the host where your Node.js application is running. Check firewall rules, database server status, and the `host` and `port` settings in your `Database` constructor options.
Double-check the `dialect` spelling. Ensure you have installed the correct Sequelize driver package (e.g., `npm install mysql2` for MySQL, `npm install pg pg-hstore` for PostgreSQL) in addition to `sequelize` and `ltijs-sequelize`.
Ensure you import or require the `Provider` export correctly from `ltijs`, typically as `import { Provider as LtiProvider } from 'ltijs'` or `const lti = require('ltijs').Provider`.Ensure that an instantiated `ltijs-sequelize` `Database` object is correctly passed to the `plugin` field in `lti.setup` configuration: `lti.setup('LTIKEY', { plugin: db }, { ...options })`.Manually create the database on your database server *before* running your application, or configure your database user with permissions to create databases if using a dialect that supports automatic database creation (though this is less common for security reasons).