
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.
Requirements
- PHP 8.0 or higher
- Flarum 1.x
- cURL PHP extension
- ImgLink API key (free)
Modern communities, developer discussion boards, open source projects
What's included
Installation Guide
Follow these steps to integrate ImgLink with Flarum.
Copy Extension.php
Copy the namespaced class into your Flarum extension's src/ directory.
cp src/Extension.php /path/to/flarum/extensions/imglink/src/
Register the extension
Add \ImgLink\Flarum\Extension to your extend.php or bootstrap.php per Flarum extension docs.
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 ];
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.


