Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Luzmo Viewer

No security coverage Under active development

This module allows you to embed Luzmo dashboards into your Drupal site using a custom field. You can configure authentication and choose whether to use remote or local Javascript libraries for displaying the dashboards.

This module intend to add a custom field that allow users to display Luzmo dashboard ID using javascript embed API.

Features

The module allow content editor to embed dashboard.
Dashboard can be displayed using integration key and token but site builder can also use embed tokens to display the dashboards.

Post-Installation

Module settings

Once installed go to /admin/config/system/luzmo-settings and change settings.

You'll need to fill:
- authkey: with your Luzmo API key
- authtoken: with your token API key
- luzmo.js location: define the location of the Luzmo embed library .js file. Default use remote version of the library.
- Luzmo App Server: you can change here the url of the Luzmo app server, default is https://app.luzmo.com/

The Account settings for logged-in or anonymous users allow you define user information required for authorisation.
It is only required if you need to request an authorisation.

Luzmo configuration

Create an integration on Luzmo ( https://app.luzmo.com/integrations ).
Select the dashboard you want to be embedded on drupal.
At the end of the process get the key & token.

You can still add dashboard later, just do not re-generate key and token.

Field creation

After that, create a Luzmo viewer field on your entity.
There is no settings for the form widget.
In the display you can set if formatter need to request an authorisation.

Additional Requirements

The module require Luzmo embed web component. You can use it remotely or localy https://socket.dev/npm/package/@luzmo/embed

If you decide to request an authorization , please make sure that users/suborganisations will have permissions to access the data.

Additional Information

Field cache

When authorisation is request, field use a per user cache with the max-age set to the authorisation inactivity interval time.

How can I alter cache?

Use drupal preprocess to alter cache contexts, ex:


/**
 * Implements hook_preprocess_HOOK().
 */
function hook_preprocess_field(&$variables) {
  // conditions
  foreach ($variables["items"] as &$items) {
    $items['content']["#cache"]["contexts"][] = 'cookies:luzmoFilters';
  }
}

I want to alter authorisation

Module implement a custom hook that allow you alter the authorisation before it's requested.
Example, it can allow to pre-fill dashboard filters.

Module implemant a hook: hook_luzmo_viewer_dashboard_javascript_authorisation_alter that can be called in module or theme.

Example:
I want to alter dashboard filters

/**
 * Alter authorisation settings to add filters based on cookie.
 *
 * {@see hook_luzmo_viewer_dashboard_javascript_authorisation_alter}.
 */
function hook_luzmo_viewer_dashboard_javascript_authorisation_alter(&$authorizationSettings, $dashboard_id) {
  $luzmoFilters = Drupal::request()->cookies->get('luzmoFilters');
  if (!empty($luzmoFilters)) {
    $luzmoFilters = json_decode($luzmoFilters, TRUE);
    foreach ($luzmoFilters as $filter_dashboard_id => $filters) {
      if ($filter_dashboard_id == $dashboard_id) {
        $authorizationSettings['filters'] = $filters;
      }
    }
  }
}
Drupal 9–11

Ask your assistant about Luzmo Viewer

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Mar 2024
Latest release
2 months ago
Releases (12 mo)
5 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.1.2 Stable 9–11 Aug 6, 2026
1.1.x-dev Dev 9–11 Aug 5, 2026
1.1.1 Stable 9–11 Apr 9, 2026
1.1.0 Stable 9–11 Apr 7, 2026
1.0.0 Stable 9–11 Nov 6, 2025
1.0.x-dev Dev 9–11 Mar 13, 2024