rchehd/reqres_users

Provides a block listing users from the Reqres dummy API.

Maintainers

Package info

github.com/rchehd/reqres_users

Type:drupal-module

pkg:composer/rchehd/reqres_users

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.0.3 2026-03-02 20:39 UTC

This package is auto-updated.

Last update: 2026-03-02 20:40:37 UTC


README

Drupal 10/11 module that fetches users from the Reqres dummy REST API and displays them in a paginated, AJAX-powered block.

Features

  • Block showing user email, forename, and surname in a table
  • AJAX pagination — page changes replace only the block, no full reload
  • Configurable items per page, cache TTL, and column labels
  • API response cached with hash-based invalidation (cache is busted only when data changes)
  • API key stored in Drupal State — never written to config/sync or version control
  • Filter extension point via a Symfony event
  • Multiple block instances on the same page are fully supported
  • PHPUnit unit tests runnable outside a full Drupal installation

Requirements

  • PHP 8.1+
  • Drupal 10 or 11
  • drupal:block module (core)
  • A Reqres API key (obtain from reqres.in)

Installation

Via Composer (recommended)

composer require rchehd/reqres_users
drush en reqres_users

Setup Reqres API key

  1. Visit reqres.in and create an account.
  2. Then, visit your profile page and copy the API key.
  3. Paste it here - /admin/config/services/reqres-users
  4. Clear the cache if you have changed the API key.