Skip to main content

Installation

Install the S4Kit SDK using your preferred package manager:

Configuration

Create an S4Kit client instance with your configuration:

Configuration Options

OptionTypeRequiredDescription
apiKeystringYesYour S4Kit API key (starts with sk_live_ or sk_test_)
connectionstringNoDefault SAP instance alias to use for requests
baseUrlstringNoCustom API URL (default: https://api.s4kit.com)
servicestringNoDefault OData service name

Environment Variables

We recommend storing your API key in environment variables:
Never commit API keys to source control. Use .env files or secrets management.

Example .env File

TypeScript Support

The SDK is written in TypeScript and provides full type definitions out of the box:

Generated Types

For full type safety with your SAP entities, use the CLI to generate types from OData metadata:
Then use the types in your code:
See the CLI documentation for more information on type generation.

Multiple Clients

You can create multiple client instances for different environments:
Or override the connection per-request: