@uveysservetoglu/kobil-core
v1.0.0
Published
Shared foundation for the KOBIL SDK family: OAuth token acquisition/caching (post & basic), a common error type, and an HTTP base for typed clients.
Readme
@uveysservetoglu/kobil-core
Shared foundation for the KOBIL SDK family (@uveysservetoglu/kobil-payment, @uveysservetoglu/kobil-chat, @uveysservetoglu/kobil-sign, …).
You normally don't use this directly — the module packages depend on it. It provides:
DefaultTokenProvider— OAuth2client_credentialstoken acquisition with in-memory caching (single in-flight request, honoursexpires_in). Modes:post(form body, default) orbasic(HTTP Basic header).KobilError— base error all module errors extend (statusCode,responseBody).KobilServiceClient— HTTP base for typed clients (bearer + send + error wrapping, JSON / arbitrary-body / binary-download helpers).credentialsFromEnv— readsKOBIL_TOKEN_ENDPOINT,KOBIL_CLIENT_ID,KOBIL_CLIENT_SECRET,KOBIL_TOKEN_AUTH_MODE.
Works from both TypeScript and JavaScript (ships compiled JS + .d.ts). Requires Node 18+
(global fetch).
License
MIT
