1.0.2 • Published 1 month ago
swium-sdk v1.0.2
Swium SDK
SDK to easily create swium add-ons.
Install
npm i swium-sdk
Example
import { addonFactory } from "swium-sdk";
addonFactory({
info() {
return {
name: "Example",
nsfw: false,
language: "en",
author: {
name: "Gabriel",
email: "041337@proton.me",
website: "https://example.com",
},
adverts: {
allow: false,
},
};
},
}).unwrap().listen(3000)
How this works?
An add-on is a simple GraphQL server that implements a few endpoints
- Info It is used to obtain the add-on information
- Page It is used to return comics from a page, for example "latest" or "popular"
- Search It is used to obtain a list of comics by
query
andpage
- Comic It is used to obtain the data of a comic by
id
- Chapter It is used to obtain the data of a chapter by
id
andnumber