Modern LTI 1.3 toolkit, built for TypeScript.
Core Features
- LTI 1.3 OIDC Flow - Complete authentication and launch verification
- Security - JWT verification, nonce validation, replay attack prevention
- Assignment and Grade Services (AGS) - Score submission to LMS
- Session Management - Secure session creation and retrieval
- Client Management - Platform and deployment configuration
Installation
npm install @lti-tool/core
Quick Start
import { LTITool } from '@lti-tool/core';
const ltiTool = new LTITool({
stateSecret: new TextEncoder().encode('your-secret-key'),
keyPair, // Your RSA keypair
storage: new MemoryStorage(),
});
// Configure your LMS
const clientId = await ltiTool.addClient({
/* ... */
});
await ltiTool.addDeployment(clientId, {
/* ... */
});
// Handle LTI flow
const authUrl = await ltiTool.handleLogin(loginParams);
const payload = await ltiTool.verifyLaunch(idToken, state);
const session = await ltiTool.createSession(payload);
Documentation
Security
Production security features
- JWT signature verification using platform JWKS
- Nonce validation prevents replay attacks
- State verification prevents CSRF
- Client ID and deployment validation
Classes
- LTITool
Interfaces
- LTIClient
- LTIConfig
- LTIDeployment
- LTIDynamicRegistrationSession
- LTILaunchConfig
- LTISession
- LTIStorage
Type Aliases
- DeepLinkingContentItem
- DeepLinkingFile
- DeepLinkingHtml
- DeepLinkingImage
- DeepLinkingLink
- DeepLinkingLtiResourceLink
- DynamicRegistrationForm
- LTI13JwtPayload
- LTIMessage
- OpenIDConfiguration
- RegistrationRequest
- RegistrationResponse
Variables
- ContentItemSchema
- DynamicRegistrationFormSchema
- HandleLoginParamsSchema
- LTI13JwtPayloadSchema
- LTI13LaunchSchema
- LTI13LoginSchema
- LTIMessagesArraySchema
- RegistrationRequestSchema
- RegistrationResponseSchema
- SessionIdSchema
- VerifyLaunchParamsSchema
Functions
- isServerlessEnvironment