0.1.1 • Published 3 months ago
eshop-os-sdk
Licence
MIT
Version
0.1.1
Deps
0
Size
60 kB
Vulns
0
Weekly
0
eshop-os-sdk
TypeScript SDK for the eshopOS public API.
This package is published on npm and maintained by the eshopOS team.
Docs: https://docs.dukalinks.co.ke
Install
bun installThen in your app workspace:
bun add eshop-os-sdkOr install it directly from npm:
npm install eshop-os-sdkFor preview builds that track the latest canary release, install the next channel:
npm install eshop-os-sdk@nextUsage
import { EshopOSPublicClient } from 'eshop-os-sdk';
const client = new EshopOSPublicClient({
baseUrl: 'http://localhost:8080',
apiKey: process.env.ESHOPOS_PUBLISHABLE_KEY,
mode: 'test',
});
const countries = await client.listSupportedPaymentCountries();Auth
You can pass one of:
apiKeyfor key-based integrations (pk,sk,ck)accessTokenfor OAuth app integrations (eshopos_oat_...)
Do not pass both in one client instance.
SDK sends these headers automatically:
Authorization: Bearer <token>X-EshopOS-Mode: test|live(ifmodeis provided or inferred)
Key Prefixes
- publishable:
eshopos_test_pk_.../eshopos_live_pk_... - secret:
eshopos_test_sk_.../eshopos_live_sk_... - system(client):
eshopos_test_ck_.../eshopos_live_ck_... - oauth access token:
eshopos_oat_...
Generation
OpenAPI operation metadata is generated from openapi/public-v1.yaml:
bun run sdk:generateErrors
Non-2xx responses throw PublicApiError with:
statuscoderequestIddetails
License
This package is released under MIT.