Skip to main content

Architecture overview

SDK generator

The SDK generator is a tool integrated in @digitalsdk/generator that generates a custom-made SDK for each customer. It uses the customer-specific Open API definitions of Cloud APIs and the list of schemas exposed in InsuranceSuite.

You only need to run the generator once for each application, as the SDK is meant to be checked into source control as part of the application. Once generated, you can use the SDK as a standard module unless there are changes in the APIs, in which case you need to regenerate the SDK.

Generated SDK

After running the SDK generator, a folder containing the generated SDK will be created in the /generated directory of your application. You can use this generated SDK directly in your application.

Before that, install @digitalsdk/internal dependencies in your application (these are internal sub-dependencies that the generated code uses, you won't be using them directly).

The generated SDK contains the following utilities:

API handlers

A set of functions that wrap the HTTP requests to the Cloud APIs. These functions are generated from the Open API definitions of Cloud APIs. They provide a more developer-friendly way to interact with the APIs to perform tasks such as authentication flow, error handling and parsing of payloads and responses.

TypeScript types

A set of TypeScript types that are generated from the Open API definitions of Cloud APIs. These types are used by the API handlers to define the payload and response types of the API requests.

Schema functions

A set of functions to retrieve information from the schemas exposed in InsuranceSuite. These schemas are useful if you need to have runtime information about the different entities existing in Cloud APIs. For example, you can use them to dynamically generate or validate forms based on the schemas of Cloud APIs.