@mcp-abap-adt/sap-aicore-auth
v30.0.0
Published
SAP AI Core service-key token exchange (TokenProvider, parseServiceKey, serviceKeyCredential).
Readme
@mcp-abap-adt/sap-aicore-auth
SAP AI Core service-key token exchange: AICORE_SERVICE_KEY holds OAuth client
credentials, not a token, so something has to exchange them, cache the result
and refresh it before expiry.
Installation
npm install @mcp-abap-adt/sap-aicore-authUsage
import { serviceKeyCredential } from '@mcp-abap-adt/sap-aicore-auth';
const { credential, apiBaseUrl } = serviceKeyCredential(process.env.AICORE_SERVICE_KEY!);
// credential: IBearerCredential — parsing and the token exchange happen lazily,
// on the first credential.token() call, so a deployment that never names this
// credential does not need the key to be present or valid.Lower-level building blocks (TokenProvider, parseServiceKey) are also exported
for consumers that already hold parsed client credentials or a service key.
