Scan your whole stack
Are you using @lovebowls/api?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.5.0
@lovebowls/api was last scanned on 29 Nov 2026 at version 0.5.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.5.0 LATEST | 29 Nov 2026 | No rules fired |
| 0.4.0 | 29 Nov 2026 | No rules fired |
| 0.3.0 | 28 Nov 2026 | No rules fired |
| 0.2.0 | 28 Nov 2026 | Not shown |
Findings for v0.5.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.5.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
JavaScript SDK for the lovebowls Public API: your club's details, competitions, fixtures, results and league tables, and (from 0.2) member login with the signed-in member's own details and calendar, and (from 0.4) the member's availability and published teamsheets, for a website you build yourself.
Zero dependencies. Works in browsers and Node 18+ (it uses the global fetch). Written in TypeScript;
the types are generated from the API's OpenAPI contract.
npm install @lovebowls/api
Or, with no build step, from jsDelivr:
<script type="module">
import { LovebowlsClient } from "https://cdn.jsdelivr.net/npm/@lovebowls/api@0.5.0/+esm";
// or: ".../npm/@lovebowls/api@0.5.0/dist/index.js"
</script>
<ul id="fixtures"></ul>
<script type="module">
import { LovebowlsClient } from "https://cdn.jsdelivr.net/npm/@lovebowls/api@0.5.0/+esm";
const lb = new LovebowlsClient({ apiKey: "lb_pk_..." }); // your publishable key
const page = await lb.listFixtures("YOUR-CLUB-ID", { limit: 10 });
for (const f of page.items) {
const li = document.createElement("li");
li.textContent = `${f.start.slice(0, 10)} ${f.opponent ?? f.eventName}`;
document.getElementById("fixtures").append(li);
}
</script>
import { LovebowlsClient, LovebowlsApiError } from "@lovebowls/api";
const lb = new LovebowlsClient({ apiKey: process.env.LOVEBOWLS_API_KEY });
try {
const club = await lb.getClub("YOUR-CLUB-ID");
console.log(club.name, club.teams.map((t) => t.name));
} catch (e) {
if (e instanceof LovebowlsApiError) console.error(e.status, e.code, e.requestId);
else throw e;
}
A publishable key (lb_pk_...) is meant for browsers: it works only from the origins listed on the
key, and only for reading. Never put a server key in a page: the API refuses it from a browser
(server_key_in_browser), and anyone can read what a page sends. Keep server keys in server code and
environment variables.
new LovebowlsClient({
apiKey: "lb_pk_...", // required; sent as X-Api-Key
auth, // optional: a LovebowlsAuth, for member methods
memberToken, // optional: a token (or async function) you already hold
baseUrl: "https://api.lovebowls.co.uk/v1", // optional, this is the default
fetch: customFetch, // optional, default globalThis.fetch
});
Method names are the API's operationIds. Every method returns a promise and throws
LovebowlsApiError on failure. Responses are the API's JSON unchanged: dates stay ISO strings.
| Method | Returns |
|---|---|
getClub(clubId) |
Club: name, time zone, teams, current season |
listCompetitions(clubId, { kind? }) |
{ items: Competition[] } (not paged) |
listFixtures(clubId, { from?, to?, competition?, team?, kind?, limit?, cursor? }) |
Page<Fixture> |
iterateFixtures(clubId, filters?) |
AsyncIterable<Fixture>, all pages |
getFixture(clubId, fixtureId) |
Fixture |
getLeague(leagueId) |
League with its table (leagues have no club id) |
getMe(clubId) |
Me: the signed-in member's own record. Needs a member token |
getMyCalendar(clubId, { from?, to? }) |
{ items: CalendarEntry[] }: the member's own calendar. Needs a member token; from/to as for fixtures |
listMyAvailability(clubId, { from?, to? }) |
{ fixtureIds: string[] }: the fixtures the member is available for (to exclusive). Needs a member token |
setMyAvailability(clubId, fixtureId) |
AvailabilityChange { available: true, fixtureIds }: marks the member available (a PUT). Idempotent. Needs a member token |
clearMyAvailability(clubId, fixtureId) |
AvailabilityChange { available: false, fixtureIds }: clears it (a DELETE). Idempotent. Needs a member token |
getTeamsheet(clubId, fixtureId) |
Teamsheet: the published selection, rink by rink. Needs a member token |
listNews(clubId, { limit?, cursor? }) |
Page<NewsSummary>: news, newest first (from 0.5). A member also gets the members-only articles |
iterateNews(clubId, { limit? }) |
AsyncIterable<NewsSummary>, all pages |
getNewsArticle(clubId, articleId) |
NewsArticle with its sanitised bodyHtml and attachments |
listHonours(clubId) |
{ items: Honour[] }: the honours board, newest year first (not paged) |
listLifeMembers(clubId) |
{ items: LifeMember[] } (not paged) |
listTrophies(clubId) |
{ items: Trophy[] }: without their winners (not paged) |
getTrophy(clubId, trophyId) |
TrophyWithWinners: the trophy and every year's winners, newest first |
Filters:
from (inclusive) and to (exclusive) take a Date or an ISO string. A date-only string such as
"2027-04-01" is sent as is. Give both or neither; with neither you get the club's current season.
A range may not exceed 400 days.competition takes one competition id or an array (sent as a repeated parameter).team is a team id from getClub; kind is "match" or "event".limit is 1 to 100 (default 50).listCompetitions answers with { items } rather than a bare array, as the contract says.
Draft clubs (from 0.3). A club that is not published answers 404 club_not_found unless a member of that
club is logged in. So the public methods (getClub, listCompetitions, listFixtures, iterateFixtures,
getFixture, getLeague, and the content reads listNews, iterateNews, getNewsArticle, listHonours, listLifeMembers,
listTrophies, getTrophy) send the member token whenever the client holds one (auth or memberToken), and
nothing changes when it does not. If the API refuses that token, a client with auth renews it once (if it can),
otherwise clears the session and repeats the call as a visitor; a memberToken you supply is not retried.
listFixtures returns one page: { items, nextCursor }. nextCursor is null on the last page;
otherwise pass it back as cursor, with the same filters. iterateFixtures does that for you:
for await (const fixture of lb.iterateFixtures("YOUR-CLUB-ID", {
from: "2027-04-01",
to: "2027-10-01",
competition: ["COMP-ID-1", "COMP-ID-2"],
})) {
console.log(fixture.start, fixture.result?.text);
}
The content reads need only your key. With a member token (auth or memberToken) a member of the club also gets the
members-only news (membersOnly: true); a visitor, and someone signed in who is not a member of the club, get the public
answer, never an error. A news cursor belongs to one sign-in state (with a token or without): keep it the same while paging, which
iterateNews does.
for await (const item of lb.iterateNews("YOUR-CLUB-ID", { limit: 10 })) console.log(item.title, item.membersOnly);
const article = await lb.getNewsArticle("YOUR-CLUB-ID", id);
container.innerHTML = article.bodyHtml; // already sanitised by the API; serve your page with a Content-Security-Policy as well
bodyHtml keeps p br strong b em i u s a ul ol li h2-h6 blockquote img table and a span with only bold, italic and underline styles;
scripts, event attributes and other styles never survive. A missing article throws news_not_found (404), a missing trophy
trophy_not_found. See the guide.
Every failure is a LovebowlsApiError (an Error) with:
| Field | Meaning |
|---|---|
status |
HTTP status; 0 for network_error |
code |
stable machine-readable code: branch on this |
title, detail |
for people; may change. detail may be null |
requestId |
quote it when asking for support |
retryAfter |
seconds to wait, from Retry-After on 429 and 503; else null |
code is the API's problem code, for example api_key_invalid, member_token_invalid, not_a_member, origin_not_allowed,
server_key_in_browser, club_mismatch, feature_not_in_plan, invalid_request, invalid_cursor,
club_not_found, fixture_not_found, league_not_found, rate_limited, upstream_error
(safe to retry). The SDK adds some of its own:
network_error: no answer (offline, DNS failure, a blocked cross-origin call, an abort);invalid_response: an answer that is not what the API sends (a non-JSON body, an error without a
problem document, or a paging cursor that repeats);member_token_required: a member method with no usable token, so no request was made (status 0);login_failed, state_mismatch: the sign-in did not complete (see Member login).Neither the API key nor a member token is ever included in an error message.
try {
await lb.getFixture(clubId, id);
} catch (e) {
if (e.code === "fixture_not_found") { /* show "no such fixture" */ }
else if (e.code === "rate_limited") await new Promise((r) => setTimeout(r, (e.retryAfter ?? 1) * 1000));
else throw e;
}
Member methods (getMe, getMyCalendar) need a member token: the member signs in on the
lovebowls login page and your page receives a short-lived token. LovebowlsAuth does the whole OAuth
flow (authorization code with PKCE, plain fetch, no other library); LovebowlsClient then sends the
token as Authorization: Bearer <token> on member calls only. A page that never logs anyone in needs none
of this.
You need two things from lovebowls: your OAuth client id, and your page's redirect URI added to the
client's list. The redirect URI must match exactly (scheme, host, path, trailing slash); anything else is
refused by Wix at the login page. It is the page that calls handleRedirect().
Use one page as both the login button and the return page. Import from the copy the API serves (no CDN) or from jsDelivr:
<button id="login">Log in</button> <button id="logout" hidden>Log out</button>
<pre id="me"></pre>
<script type="module">
import { LovebowlsClient, LovebowlsAuth } from "https://api.lovebowls.co.uk/docs/example/lovebowls-api.js";
// or: from "https://cdn.jsdelivr.net/npm/@lovebowls/api@0.5.0/+esm"
const auth = new LovebowlsAuth({
clientId: "YOUR-OAUTH-CLIENT-ID",
redirectUri: location.origin + location.pathname, // must be on the client's list, exactly
});
const lb = new LovebowlsClient({ apiKey: "lb_pk_...", auth });
const CLUB = "YOUR-CLUB-ID";
const out = document.getElementById("me");
async function show() {
const loggedIn = auth.isLoggedIn();
document.getElementById("login").hidden = loggedIn;
document.getElementById("logout").hidden = !loggedIn;
out.textContent = "";
if (!loggedIn) return;
try {
out.textContent = JSON.stringify(await lb.getMe(CLUB), null, 2);
} catch (e) {
if (e.code === "not_a_member") out.textContent = "You are not a member of this club.";
else if (e.code === "member_token_required" || e.code === "member_token_invalid") show(); // session ended: offer login
else throw e;
}
}
try { await auth.handleRedirect(); } catch (e) { console.error(e.code); } // true if we just came back from the login
auth.onChange(show);
document.getElementById("login").onclick = () => auth.login();
document.getElementById("logout").onclick = () => auth.logout();
show();
</script>
handleRedirect() is safe to call on every page load: it returns false when the page is not a login
return. When it is, it checks the state it stored before leaving, exchanges the code, and removes
#code=...&state=... from the address bar.
new LovebowlsAuth({
clientId: "...", // required
redirectUri: "https://...", // required, exact match on the client's list
storage: "session", // "session" (default) | "local" | "memory" | your own { getItem, setItem, removeItem }
offlineAccess: false, // true: also get a refresh token (see below)
postLogoutUrl: redirectUri, // where Wix sends the browser after logout()
fetch: customFetch, // optional
});
Methods: login(), handleRedirect(), isLoggedIn(), getAccessToken(), logout({ redirect? }),
onChange(cb) (returns an unsubscribe function; cb(loggedIn) also fires when an expired session is dropped).
By default the login asks for only an access token, which Wix issues for 4 hours. It is kept in
sessionStorage (gone when the tab closes) under the key lovebowls.auth.tokens; during the trip to the login
page the PKCE secret is in sessionStorage too (lovebowls.auth.pkce) and is deleted on return.
storage: "local" survives closing the browser. storage: "memory" keeps the token in the page only, so it is
lost on reload. Any script on your page can read browser storage, so do not load scripts you do not trust.
When the 4 hours pass, isLoggedIn() turns false, the stored token is removed, and member methods throw
member_token_required without making a request: show your login button again.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.