> ## Documentation Index
> Fetch the complete documentation index at: https://thehyperstack.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Moodle Plugin

> Issue a credential automatically when a learner completes a Moodle course, with the Hyperstack Credentials plugin.

The **Hyperstack Credentials** plugin connects your Moodle site to Hyperstack. Teachers choose one or more credential groups for a course. When a learner completes the course, Hyperstack issues the credential and emails it to the learner.

Works with Moodle 4.5 to 5.3.

![The Hyperstack credentials page of a Moodle course with two credential groups, one selected](https://mintcdn.com/hyperstack/sgzvGHqvTXXJc46_/images/moodle-plugin-course-groups.webp?fit=max\&auto=format\&n=sgzvGHqvTXXJc46_\&q=85\&s=4cacfadadce04cfea9668dcf78ca180a)

## Before you start

* A [credential group](https://thehyperstack.com/docs/tutorials/credential-setup/creating-credential-group.md) with its design.
* A Hyperstack account with administrator access, to create an API key. The free plan covers up to 20 recipients.
* A Moodle site administrator.
* Moodle's cron running. Moodle works out course completion in a scheduled task, so credentials go out a few minutes after a learner completes the course.

## Step 1: install the plugin

**1. Download the plugin**

Download `local_hyperstack.zip` from the [latest release on GitHub](https://github.com/hyperstack/moodle-local_hyperstack/releases/latest). The plugin will also be on the Moodle Marketplace.

**2. Install it in Moodle**

Go to **Site administration**, **Plugins**, **Install plugins**, upload the zip, and complete the upgrade.

## Step 2: connect Moodle to Hyperstack

**1. In Hyperstack, create an API key**

Open **Settings**, **Developers**, and create an API key. Copy it.

**2. In Moodle, open the plugin settings**

Go to **Site administration**, **Plugins**, **Local plugins**, **Hyperstack Credentials**. Paste the key in **API key** and click **Save changes**. Moodle stores the key encrypted.

**3. Test the connection**

Click **test the connection**. Moodle shows your Hyperstack organization name and credit balance.

![The Hyperstack Credentials settings page in Moodle with the API key and API address](https://mintcdn.com/hyperstack/sgzvGHqvTXXJc46_/images/moodle-plugin-settings.webp?fit=max\&auto=format\&n=sgzvGHqvTXXJc46_\&q=85\&s=9097bf2ee08508a8f34878072ffdd906)

![Moodle's Test the Hyperstack connection page: Connected to the Hyperstack account, with the credits left](https://mintcdn.com/hyperstack/sgzvGHqvTXXJc46_/images/moodle-plugin-test.webp?fit=max\&auto=format\&n=sgzvGHqvTXXJc46_\&q=85\&s=e7add9201ef8b820f329c0b1acb3a91e)

Leave **API address** as it is.

## Step 3: choose a course's credential groups

A teacher with editing rights, or a manager, does this in each course.

1. Check that the course has **Completion tracking** on (course settings) and **course completion conditions** set (**More**, **Course completion**). Without them nothing is issued, and the plugin page shows a warning.
2. In the course, open **More**, **Hyperstack credentials**.
3. Select the credential groups to issue and click **Save changes**. Archived groups are not listed.

![The More menu of a Moodle course with Hyperstack credentials](https://mintcdn.com/hyperstack/sgzvGHqvTXXJc46_/images/moodle-plugin-course-menu.webp?fit=max\&auto=format\&n=sgzvGHqvTXXJc46_\&q=85\&s=d9ad8746f545bb978314777f6b788b8d)

> [!TIP]
>
> Learners who completed the course before you set it up? Click **Issue to past completers** on the same page.

## What learners get

When a learner completes the course, they get one credential from each selected group, by email, a few minutes later. A learner gets a credential from the same course and group only once. Each credential uses one credit, as usual.

Suspended and deleted Moodle users are skipped.

## Follow what was issued

On the plugin page, click **See who received a credential**. The report lists each learner with the credential group, the status and a link to the credential.

![The Issued credentials report in Moodle with three learners, each Issued, with View credential links](https://mintcdn.com/hyperstack/sgzvGHqvTXXJc46_/images/moodle-plugin-report.webp?fit=max\&auto=format\&n=sgzvGHqvTXXJc46_\&q=85\&s=a45a3079b85e17c05cebb109ed934fd0)

| Status | Meaning |
| - | - |
| Issued | Sent. **View credential** opens it. |
| Already had it | The learner already has a credential from this group in Hyperstack, so no new one was sent. |
| Queued | Waiting for Moodle's cron. |
| Retrying | Hyperstack could not be reached, or your account has no credits left. Moodle tries again later by itself. |
| Failed | Not sent; the reason is shown. Fix it, then click **Retry**. |
| Skipped | The learner was suspended or deleted, or the group was unselected. |

## Troubleshooting

* **Nothing is issued**: check that cron runs, and that the course has completion tracking and completion conditions. The learner must show as complete in **Reports**, **Course completion**.
* **Hyperstack did not accept the API key**: the key was deleted or mistyped. Create a new one in Hyperstack and save it in the plugin settings.
* **The saved API key cannot be read**: the Moodle site's encryption key changed (for example after moving the site). Enter the API key again.
* **Retrying for a long time**: add credits in Hyperstack. Moodle keeps trying for about a day and a half; after that the status is Failed, and **Retry** sends it.

## Your data

To issue a credential, the plugin sends the learner's full name and email address to Hyperstack. Moodle keeps a record per learner, course and group of whether the credential was issued; Moodle's privacy tools export and delete these records. Credentials already issued stay in Hyperstack.

Course backups and copies keep the course's credential groups.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.