Library Naming Conventions (machineName)

I searched for guidance on the website was not able to find it. Please just post the URL if I missed it!

Are there any generally agreed on naming conventions for the libary.json machineName and H5P library folder name?

The H5P related content is External libraries such as docxgen and flowplayer use the library name.

I'm not sure if the "H5P." is there to differentiate H5P content from libraries, or to designate the content as officially supported content. Or perhaps both?

I suspect I should prefix my content type with a company or user name? For example, dale42.myH5PContentType or myCompany.H5PContentType.


icc's picture

Indeed, we need to create some sort of page with rules for this. Up until now, there haven't been many issues around this and everyone uses the H5P prefix to avoid any confusion with other JavaScript libraries. Some third-party libraries are missing the H5P prefix, not entirely sure on the thought behind this as most of the code are wrapped inside the H5P namespace anyway(to avoid collisions).

I suggest that you use the H5P prefix as well and then just be aware that you call your library something unique. A quick search at should reveal if it's taken. If you wish to have your own 'brandname' to ensure the recognition effect you could e.g. prefix all of your content types with H5P.Dale42ContentTypeName or something.

Be aware that you may only have one dot(.) in the machineName!
Also, try sticking to common CamelCase practices for the machineName/class names. E.g. Dale42Quiz, InteractiveDale42 etc.
... and if you could use kabab-case for the git repo that is best. E.g. h5p-dale42-quiz.

Thank you for asking!