next-ims-lti
v1.0.0
Published
Next.js LTI middleware
Downloads
48
Maintainers
Readme
next-ims-lti
Installation
npm i next-ims-lti
Example
import getLtiContext from 'next-ims-lti';
const App = ({ context }) => {
return (
<pre>
<code>{JSON.stringify(context, null, 2)}</code>
</pre>
);
};
export const getServerSideProps = async (ctx) => {
const ltiContext = await getLtiContext({
ctx,
key: 'consumer-key',
secret: 'consumer-secret',
persist: false,
cookieOptions:{
path: '/',
}
});
return {
props: {
context: ltiContext,
},
};
};
export default App;