NewProfiles are here!View user profiles guide
Flarum
PHPModern Stack

ImgLink for Flarum

The ImgLink Flarum extension follows Flarum's PSR-4 namespace conventions under \ImgLink\Flarum\Extension. It exposes a static upload() method that validates config on first call, retries failed uploads with exponential backoff, and returns a full upload response suitable for storing in Flarum's media table — including url, thumbnail URL, and image dimensions. Zero Composer dependencies, PHP 8.3 tested.

Platform
Flarum 1.x
Runtime
PHP 8.0+
Dependencies
Zero
CI Status
Passing

Requirements

  • PHP 8.0 or higher
  • Flarum 1.x
  • cURL PHP extension
  • ImgLink API key (free)
Used by

Modern communities, developer discussion boards, open source projects

Download ZIP

What's included

PSR-4 namespace: \ImgLink\Flarum\Extension
Static upload() with typed parameters
First-call config validation
Exponential backoff retry loop
Returns full upload object (url, thumbnail, dimensions)
Flarum-compatible exception handling
No Composer dependencies required
PHP 8.3 CI tested

Installation Guide

Follow these steps to integrate ImgLink with Flarum.

01

Copy Extension.php

Copy the namespaced class into your Flarum extension's src/ directory.

cp src/Extension.php /path/to/flarum/extensions/imglink/src/
02

Register the extension

Add \ImgLink\Flarum\Extension to your extend.php or bootstrap.php per Flarum extension docs.

03

Pass config on upload

Build the config array and pass it when calling the upload method.

$config = [
  "apiBase" => "https://imglink.cc",
  "apiKey"  => "YOUR_KEY_HERE",
  "retries" => 3
];
04

Invoke from upload listener

Call \ImgLink\Flarum\Extension::upload() in your media upload listener.

$result = \ImgLink\Flarum\Extension::upload($path, $config);
$url = $result['url'];

Why host images on ImgLink?

Global CDN

Images served from a global edge network. Sub-100ms load times. No bandwidth cost to your forum server.

Scoped API Keys

One API key per forum. Revoke or rotate instantly. Keys never leave your config file — never hardcoded.

Retry Safety

Exponential backoff on every upload. Images never fail silently — retries handle transient network issues.

Ready to deploy ImgLink on Flarum?

Download the plugin, add your API key, and go live in under 10 minutes. Free to use — no credit card required.