rchehd / reqres_users
Provides a block listing users from the Reqres dummy API.
v0.0.3
2026-03-02 20:39 UTC
Requires
- php: >=8.1
- guzzlehttp/guzzle: ^7.0
- symfony/event-dispatcher: ^6.4 || ^7.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- drupal/coder: ^8.3
- drupal/core: ^10 || ^11
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^10.0 || ^11.0
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/syncor 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:blockmodule (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
- Visit reqres.in and create an account.
- Then, visit your profile page and copy the API key.
- Paste it here - /admin/config/services/reqres-users
- Clear the cache if you have changed the API key.