Install Javascript Library

Last updated on
22 November 2024

This module is installed in the same way as any other module. The installation can be done manually or preferably with composer.

Manual installation

  1. Place the klaro Drupal module in the modules directory of your Drupal installation.
  2. Install the klaro-org/klaro-js javascript library in your libraries folder.
  3. Enable the 'Klaro!' module in 'Extend': /admin/modules.
  4. Set up user permissions: /admin/people/permissions#module-klaro (see below)
  5. Customize settings: /admin//config/user-interface/klaro

Using composer

We recommend to use composer for step 1 and 2 (see above).

To install the module, enter:

composer require drupal/klaro

The package drupal/klaro_js is required by drupal/klaro and will install the javascript library. (You may have to whitelist drupal/klaro_js in your definition of repo.packagist.org in your project's composer.json.)

The original library is klaro-org/klaro-js. The maintainers of drupal/klaro_js keep the package synchronized with the original package.

Install via composer.libraries.json (Legacy)

For installing the klaro js library via composer.libraries.json you need the composer-merge-plugin and add the file to the extra merge-plugin section of your root composer.json:

"extra": {
  "merge-plugin": {
      "include": [
          "web/modules/contrib/klaro/composer.libraries.json"
      ]
  }
}

and then require the package:

composer require "klaro-org/klaro-js":"0.7.22"

More infos how to do that

Include in root composer.json (Legacy)

If you want to keep on track for your Software Bill or Materials, you can add this composer entry to your composer.json:

    "repositories": {
        [...],
        "klaro-org.klaro-js": {
            "type": "package",
            "package": {
                "name": "klaro-org/klaro-js",
                "type": "drupal-library",
                "version": "0.7.22",
                "dist": {
                    "url": "https://github.com/klaro-org/klaro-js/archive/refs/tags/v0.7.22.zip",
                    "type": "zip"
                }
            }
        }
    }

and then require the package:

composer require "klaro-org/klaro-js":"0.7.22"

Help improve this page

Page status: No known problems

You can: