cl-modio
2024-10-12
A client library for the mod.io API.
Upstream URL
Author
Yukari Hafner <shinmera@tymoon.eu>
Maintainer
Yukari Hafner <shinmera@tymoon.eu>
License
zlib
## About cl-modio
This is a client library to interact with the "mod.io"(https://mod.io) platform to manage "mods" or extensions for games and other applications. It covers the full v1 API and includes convenience methods to make interacting with the API as well as syncing mods and so on easy.
## How To
Before you can get started you must register an account on mod.io and create your game. Navigate to its admin page, and select the ``API`` category. Copy the key and API path out and create a new ``client`` instance with them:
:: common lisp
(setf modio:*client* (make-instance 'modio:client :base-url "...." :api-key "...."))
::
Most relevant API endpoints will be available without authentication, but anything that needs to edit, delete, or create new objects in the very least will require an authenticated client. Mod.io offers a multitude of authentication methods, depending on the platform you're connected to.
For basic email auth, you can always proceed like this:
:: common lisp
(modio:authenticate/email-request T "user@example.com")
(modio:authenticate/email-exchange T "----")
::
Once completed, you can persist the authentication data somewhere via ``extract-user-properties`` and later restore them via ``restore-user-properties``. Note that the authentication key will automatically expire (see ``valid-until``) at which point you will have to repeat the authentication.
From there you can use any of the API endpoints to read out data and update it. All return objects are automatically converted into objects for your convenience. You can simply use the various accessors and ``describe`` to poke around.