@taulo1999/kanpla-api
v1.0.9
Published
See what's for lunch at your Kanpla canteen.
Downloads
91
Readme
Kanpla API
See what's for lunch at your Kanpla canteen.
Installation
npm install @taulo1999/kanpla-api yarn add @taulo1999/kanpla-apiSetup
The extension requires four preferences, configured on the first launch.
| Preference | Where to find it | | ---------------------- | -------------------------- | | Email | Your Kanpla login email | | Password | Your Kanpla login password | | Firebase API Key | See below | | Firebase Module ID | See below |
Finding the Firebase API Key and Module ID
These values aren't exposed in the Kanpla UI, so you'll need to grab them from network traffic:
- Open app.kanpla.dk in your browser
- Open DevTools → Network tab
- Filter requests by
frontend - Find the request to the
/frontendendpoint - From the request headers, copy:
- x-goog-api-key — looks like
AIzaSyB...
- x-goog-api-key — looks like
- From the response body, search for:
- moduleId — the ID of the menu module for your canteen
Create a .env file with the values
FIREBASE_API_KEY=<firebase-api-key>
FIREBASE_KANPLA_EMAIL=<kanpla-email>
FIREBASE_KANPLA_PASSWORD=<kanpla-password>
FIREBASE_MODULE_ID=<firebase-module-id>Example
import Kanpla from "@taulo1999/kanpla-api";
const kanpla = new Kanpla({
email: process.env.FIREBASE_KANPLA_EMAIL as string,
password: process.env.FIREBASE_KANPLA_PASSWORD as string,
firebaseAPIKey: process.env.FIREBASE_API_KEY as string,
firebaseModuleId: process.env.FIREBASE_MODULE_ID as string,
});
const menu = await kanpla.getMenusByDate(new Date("2026-04-01"));
console.log("Menu from date: 2026-04-01", menu);