Search code examples
jwtprestashop

Install Third party library in Prestashop


I am trying to install a JWT Library (i.e https://github.com/web-token/jwt-framework) in Prestashop,

I am not sure how to install & use it.

Do i need to run composer require web-token/jwt-framework in PS root to install it?


Solution

  • Composer is installed by default in prestashop versions 1.7+.

    If you are starting a new project you can init your composer project along with the dependency:

    composer init --require="web-token/jwt-framework" -n  
    composer install
    

    Or if you already have an existing project simply add the dependency:

    composer require web-token/jwt-framework
    

    Then update your composer.json file to include the class in your autoload nad regenerate it:

    composer dump-autoload
    

    (Installing webservice library if u want to see documentation example: LINK)

    If u want to use library in your module here is the link to documentation on how to do it: LINK

    Although you can go to github repo of this library and download it manually.