• Resources
  • Flarum extension compatibility badges

I've put together a small API so you can add badges to your extension READMEs and posts.

The data is kindly provided via the Extiverse API, created by @luceos.

Documentation: https://docs.flarum-badge-api.davwheat.dev/
Endpoint: https://flarum-badge-api.davwheat.dev/

For example...

https://flarum-badge-api.davwheat.dev/v1/compat-latest/davwheat/custom-sidenav-links

https://flarum-badge-api.davwheat.dev/v1/compat-latest/fof/drafts


There's also an endpoint to fetch the icon for an extension, with documentation at the URL above.


Let me know if you have any questions or issues!

It would be great to have badge with flarum/core constraint used by extension. Like or .

    rob006

    I planned to do this, but the Extiverse API didn't provide this data I don't think.

    It's possible to use the Packagist API to do it, I'd assume, but that would basically be rewriting my own version of Extiverse.

      davwheat I planned to do this, but the Extiverse API didn't provide this data I don't think.

      It does, it is just less convenient than Packagist. For regular extensions it is probably better to use Packagist metadata directly (you can just pick first release from https://repo.packagist.org/p2/rob006/flarum-lang-polish.json) - it should be more efficient and data is always fresh. But for premium extensions you need to use Extiverse.

        rob006

        Ooooh, I didn't notice that!

        Packagist's data might be more up-to-date, but as far as I'm aware, it's easier to just use Extiverse on its own for simplicity.

          davwheat Packagist's data might be more up-to-date, but as far as I'm aware, it's easier to just use Extiverse on its own for simplicity.

          In your case it probably will be simpler to use Extiverse only (only one implementation to fetch metadata). Although Extiverse has some rate-limiting that may be problematic in your use case, so I would check that - displaying badges for 61 different extensions may just kill your service.

            rob006

            After the first request, the data is cached for an hour which seems to have worked ok in testing.

              davwheat But if you query each extension individually, then badges for 61 different extensions should exceed requests limit to Extiverse API.

              If you have any concerns related to the Extiverse API just voice them in the discussion 😉

              If you need less throttling, I can add something that makes it more lenient for you. If you need a shorter compatibility list I can introduce one too 😉

                luceos

                The main thing that would be a massive help is to list the latest core version that the extension supports in the extension's details. From what I've seen, I think the only other way is to include versions in my request and check against the latest version, but I'd imagine it's a waste of bandwidth to include all the versions in the request.

                We'll see if rate-limiting becomes an issue. Hopefully not, but who knows 😛

                I might end up moving it off of my Pi if it's used a fair bit, too. 😂

                a month later
                18 days later
                9 months later