I am using a library that is under the MIT license. I never used a library that I needed to include the license before, so I have no idea where to add them. I read that I should add them in my file, but the thing is my project is a site constituting of php files, is there a certain file that I need to add the license to or all the files? Also what should I add? The project came with a LICENSE.txt file and contains text. The project I am using is jsModal.

2 Answers 2


I am not a lawyer, but here are my recommendations.

The main requirement of the MIT license can be found on the jsModal license page

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

If your project is a website, you should state that you are using jsModal that it is licensed under the MIT license. You need to make the entire text of the jsModal license page (including the copyright information) available directly on your site. I do NOT think a simple hyperlink the the jsModal page is sufficient. The text must be a part of your web site. If the web site is the only place you are using jsModal, you do not need to add any licensing information to any other files. A single page stating you are using jsModal with the entire text of the MIT license is sufficient.

Edit: You should make sure that this license/copyright information is visible to the end user. Typical users won't look at your code comments, so code comments by themselves are not sufficient. You only need a single page for this license & copyright information. You don't need to add it to every page of your website.

  • so each page that uses this library I should include the license text? Do I add it as part of the site as in shown to the users or just a comment in each page that uses the library? Apr 26, 2017 at 19:02
  • 1
    No, you don't need to have the license/copyright notice on each page. One page for your entire website is sufficient. You should add it as part of the site that is shown to the user. A typical user isn't going to read your code comments. I'll update my answer to include this new information.
    – airfishey
    Apr 26, 2017 at 19:57
  • One more question, am I constrained to the file structure of the library or can I put the js and css files separately wherever I want? May 2, 2017 at 18:12

Simply put the jsModal license either in the public directory tree where you reference the script e.g. src/js/LICENSE.txt. The requirement to provide a copy of the license may also be satisfied by including a link to the license in comments of the source code.

The copyright notice can be put anywhere in the source code to satisfy the copyright notice requirement. ref

  • Mat, you appear to have posted a comment to airfishey's answer as another answer. Comments/responses to answers should not be posted as new answers, but as a comment. Nov 12, 2021 at 11:45
  • Removed quote to previous answer and updated answer. Nov 12, 2021 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.