diff --git a/docs/.vitepress/config.base.ts b/docs/.vitepress/config.base.ts index 5f3829e0..e9e5a9a6 100644 --- a/docs/.vitepress/config.base.ts +++ b/docs/.vitepress/config.base.ts @@ -98,6 +98,7 @@ export default defineConfig({ { text: 'Home Assistant', link: '/api/integrations/homeassistant' }, { text: 'Homarr', link: '/api/integrations/homarr' }, { text: 'Homepage', link: '/api/integrations/homepage' }, + { text: 'Homer', link: '/api/integrations/homer' }, ], }, ], diff --git a/docs/api/integrations/homer.md b/docs/api/integrations/homer.md new file mode 100644 index 00000000..8bb7b2cf --- /dev/null +++ b/docs/api/integrations/homer.md @@ -0,0 +1,64 @@ +# Homer + +LibrisLog can be integrated into [Homer](https://github.com/bastienwirtz/homer), +a self-hosted dashboard for your services, using its +[LibrisLog custom service](https://github.com/bastienwirtz/homer/blob/main/docs/customservices.md#librislog). + +This smart card displays your reading statistics: total books, books read, +currently reading, and want-to-read counts directly on your Homer dashboard. + +## Prerequisites + +- A running LibrisLog instance reachable from the browser you use to view + your Homer dashboard (the card fetches data client-side) +- An [API key](/api/integrations/#api-keys) with access to the + statistics endpoint + +## Configuration + +Add the following service entry to your Homer `config.yml`: + +```yaml +- name: "LibrisLog" + type: "LibrisLog" + logo: "https://docs.librislog.app/logo.png" + url: "" + apikey: "" +``` + +The card supports auto refresh, which can be enabled individually for each +service using the `updateIntervalMs` option. + +> [!WARNING] +> Homer serves your `config.yml` at `/assets/config.yml` over HTTP. The API +> key in it is readable by anyone who can access your Homer instance. Only +> include it if your Homer instance is protected by authentication or access +> controls. + +## Placeholders + +Replace the placeholders with your own values: + +| Placeholder | Example | Description | +|---|---|---| +| `` | `http://192.168.1.100:8000` | The base URL of your LibrisLog instance (http or https) | +| `` | `lk_nRHsF3jxIBDa9u....` | An API key with access to the statistics endpoint | +| `` | `http://192.168.1.100:8080` | The base URL of your Homer instance | + +## CORS + +The Homer card fetches the API directly from the browser. You must add your +Homer URL to the +[`CORS_ORIGINS`](/guide/configuration#core-settings) environment variable of +the LibrisLog backend: + +``` +CORS_ORIGINS=[""] +``` + +If the card stays empty or shows no statistics, check your browser console +for CORS errors. + +## Result + +![Homer Widget](/screenshots/integrations-homer.png) diff --git a/docs/api/integrations/index.md b/docs/api/integrations/index.md index 9635fbf4..055f0f8e 100644 --- a/docs/api/integrations/index.md +++ b/docs/api/integrations/index.md @@ -48,3 +48,6 @@ headers. For these integrations you need an **embed token**, used with the - [Homepage](/api/integrations/homepage) — Display your LibrisLog statistics on a [Homepage](https://gethomepage.dev/) dashboard using the custom API widget. +- [Homer](/api/integrations/homer) — Display your LibrisLog statistics on a + [Homer](https://github.com/bastienwirtz/homer) dashboard using the + LibrisLog custom service. diff --git a/docs/public/screenshots/integrations-homer.png b/docs/public/screenshots/integrations-homer.png new file mode 100644 index 00000000..9e6b07f2 Binary files /dev/null and b/docs/public/screenshots/integrations-homer.png differ