@lajna/spond-api-client
v0.1.1
Published
Typed TypeScript client for the unofficial Spond API
Readme
spond-client
A typed, Promise-based TypeScript port of the public API in Olen/Spond. This is an unofficial client for Spond's undocumented API and is licensed GPL-3.0-only, matching the reference project.
Install and use
npm install spond-clientimport { Spond } from "spond-client";
const client = new Spond(process.env.SPOND_USERNAME!, process.env.SPOND_PASSWORD!);
const group = await client.getGroup(process.env.SPOND_GROUP_ID!);
const events = await client.getEvents({ groupId: group.id });Do not hard-code credentials. Password authentication is lazy: the first protected call logs in at auth2/login; the access token is held only in memory for the lifetime of the client.
API
Spond: login, getProfile, getGroups, getGroup, getPerson, getPosts, getMessages, sendMessage, getEvents, getEvent, updateEvent, getEventAttendanceXlsx, and changeResponse.
SpondClub: login and getTransactions.
All methods are asynchronous and return typed promises. The constructor accepts an optional ClientOptions with a custom fetch, making browser, Node, and test runtimes supported.
Live integration test
The integration test is read-only: it verifies password login, reads the profile and configured group, and checks its events. It is skipped unless credentials are deliberately supplied through the environment.
export SPOND_INTEGRATION_USERNAME='...'
export SPOND_INTEGRATION_PASSWORD='...'
export SPOND_INTEGRATION_GROUP_ID='...'
pnpm test:integration.env.example documents the required variable names; .env is ignored by Git. Do not place credentials in source, tests, or shell history.
