@servease/sdk
v0.1.0
Published
Typed TypeScript/JavaScript SDK for the ServEase API, generated from the official OpenAPI spec.
Maintainers
Readme
@servease/sdk
Typed TypeScript/JavaScript SDK for the ServEase API. The client (types + methods)
is generated automatically from the official OpenAPI spec (servease-api.json),
so it always matches the real API surface.
Install
npm install @servease/sdkUsage
import { createServEaseClient } from "@servease/sdk";
const servease = createServEaseClient({
apiKey: process.env.SERVEASE_API_KEY!, // sk_live_... / sk_test_...
});
// Fully typed request + response, autocompletion for params and body
const { data, error } = await servease.GET("/reservations", {
params: { query: { restaurant_id: "rst_123" } },
});
if (error) {
console.error(error.error.message);
} else {
console.log(data.data);
}
// Create a reservation
const { data: reservation } = await servease.POST("/reservations", {
body: {
restaurant_id: "rst_123",
party_size: 4,
start_time: "2026-08-20T18:30:00Z",
guest: { first_name: "Jane", last_name: "Doe", email: "[email protected]" },
},
});Point the client at the staging environment if needed:
createServEaseClient({
apiKey: "sk_test_...",
baseUrl: "https://api-staging.servease.de/v1",
});Updating the SDK when the API changes
The whole SDK (types + generated client bindings) is derived from servease-api.json.
To pick up a new version of the spec, bump the package version, publish to npm and
push to GitHub in one step:
npm run spec:update -- ./path/to/new-servease-api.json patch- First argument: path to the new OpenAPI JSON file (replaces
servease-api.json). - Second argument: version bump —
patch(default),minorormajor. - Flags:
--no-publishto skipnpm publish,--no-pushto skip pushing to GitHub.
This will, in order:
- Copy the new spec into
servease-api.json. - Regenerate the TypeScript types (
npm run generate) and build the package. - Bump the version in
package.jsonand create a git commit + tag. - Run
npm publish(requires being logged in vianpm login, scope must allow publish). git push --follow-tagsto publish the release on GitHub.
Manual steps
npm run generate # regenerate src/generated/schema.ts from servease-api.json
npm run build # generate + bundle dist/ (esm + cjs + d.ts)
npm version patch # bump version, commit + tag
npm publish # publish to npm (public access)
git push --follow-tagsLicense
MIT
