n8n-nodes-elearning-magic 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +16 -62
  2. package/package.json +3 -7
package/README.md CHANGED
@@ -1,68 +1,22 @@
1
1
  # n8n-nodes-elearning-magic
2
2
 
3
- Community node that receives signed payloads from the eLearning Magic SCORM wrapper. It exposes a lightweight webhook trigger that validates the `X-EM-Signature` HMAC header (SHA-256) and optionally enforces the `X-EM-Node-Id` header before emitting the request body into your workflow.
4
-
5
- ## Features
6
- - Webhook trigger dedicated to eLearning Magic course events
7
- - HMAC validation of inbound payloads using your signing secret
8
- - Optional `X-EM-Node-Id` enforcement so each connection can stay isolated
9
- - Emits body, query, headers, and optional raw body for debugging
10
- - Customizable HTTP response body/status for Storyline debugging
11
-
12
- ## Installation
13
- From your n8n root (typically `~/.n8n`):
3
+ Webhook trigger for n8n that accepts signed payloads from the eLearning Magic platform.
14
4
 
5
+ ## Install
6
+ From your n8n directory (Community Nodes enabled):
15
7
  ```bash
16
8
  npm install n8n-nodes-elearning-magic
17
9
  ```
18
-
19
- Restart n8n and enable Community Nodes if prompted.
20
-
21
- ## Usage
22
- 1. Add the **eLearning Magic Trigger** node to a workflow.
23
- 2. Set a **Webhook Path** (e.g., `elearning-magic` or something unique per connection).
24
- 3. (Recommended) Set a **Node ID** and enable **Enforce Node ID Match**. This value must match the `X-EM-Node-Id` header sent by the eLearning Magic app.
25
- 4. Configure the **eLearning Magic Signing Secret** credential with your chosen secret. This secret signs incoming payloads; the app will use it to produce `X-EM-Signature`.
26
- 5. Copy the **Webhook URL** shown in the node’s “Webhook URLs” panel and paste it into the eLearning Magic app when creating an n8n connection. Also provide the Node ID and signing secret there.
27
- 6. Save the workflow and activate it. Incoming Storyline triggers will appear as items with `body`, `query`, `headers`, and `meta` (signature status, nodeId match, timestamp). Enable “Include Raw Body” for debugging HMAC issues.
28
-
29
- ## Expected request format
30
- - Method: `POST`
31
- - Headers:
32
- - `X-EM-Signature`: HMAC-SHA256 of the raw request body using the configured signing secret.
33
- - `X-EM-Node-Id` (optional): Must match the configured Node ID when enforcement is enabled.
34
- - Body: JSON payload forwarded by the eLearning Magic app, e.g.:
35
-
36
- ```json
37
- {
38
- "connectionId": "abc-123",
39
- "projectId": "storyline-project-id",
40
- "wrapperVersion": "1.0.17",
41
- "meta": {
42
- "learnerId": "jane.doe",
43
- "learnerName": "Jane Doe",
44
- "launchDomain": "lms.example.com",
45
- "attemptId": "attempt-001",
46
- "receivedAt": "2025-01-01T12:34:56Z"
47
- },
48
- "fields": {
49
- "score": 92,
50
- "lessonStatus": "complete",
51
- "learnerEmail": "jane@example.com"
52
- }
53
- }
54
- ```
55
-
56
- The node relays the full body; you can route on any property inside your workflow.
57
-
58
- ## Response customization
59
- - **Response Code**: HTTP status returned to the caller (default `200`).
60
- - **Response Body**: JSON string or plain text returned to the caller (default `{"received":true}`).
61
-
62
- ## Development
63
- ```bash
64
- npm install
65
- npm run build
66
- ```
67
-
68
- Publish to npm with `npm publish` once you are happy with the build output in `dist/`.
10
+ Restart n8n after install.
11
+
12
+ ## Configure
13
+ 1) Add the **eLearning Magic Trigger** node to a workflow.
14
+ 2) Set a unique **Webhook Path**.
15
+ 3) Create an **eLearning Magic Signing Secret** credential with your chosen secret.
16
+ 4) (Optional) Set a **Node ID** and enable **Enforce Node ID Match**.
17
+ 5) Copy the webhook URL from the node and paste it into the eLearning Magic app when creating an n8n connection (along with the Node ID and signing secret).
18
+ 6) Activate the workflow. Incoming events will appear as items containing the request body, headers, query, and meta flags for signature/Node ID checks.
19
+
20
+ ## Headers expected
21
+ - `X-EM-Signature`: HMAC-SHA256 of the raw body using your signing secret.
22
+ - `X-EM-Node-Id` (optional): Must match when enforcement is enabled.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-elearning-magic",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "n8n community node for receiving signed payloads from the eLearning Magic SCORM wrapper",
5
5
  "keywords": [
6
6
  "n8n-community-node",
@@ -49,14 +49,10 @@
49
49
  "n8n": {
50
50
  "n8nNodesApiVersion": 1,
51
51
  "nodes": [
52
- {
53
- "type": "dist/nodes/ElearningMagic/ElearningMagicTrigger.node.js"
54
- }
52
+ "dist/nodes/ElearningMagic/ElearningMagicTrigger.node.js"
55
53
  ],
56
54
  "credentials": [
57
- {
58
- "type": "dist/credentials/ElearningMagicApi.credentials.js"
59
- }
55
+ "dist/credentials/ElearningMagicApi.credentials.js"
60
56
  ]
61
57
  }
62
58
  }