1.0.0 • Published 4 months ago

next-ims-lti-ssl v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

next-ims-lti-ssl

Installation

npm i next-ims-lti-ssl

Example

import getLtiContext from 'next-ims-lti-ssl';

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;