In order to facilitate Adopters to connect with Sunbird System. Typescript based library to connect with APIs. It can facilitate the adopters with readily available data models.
Criteria
Value
Current Release Branch
release-4.5.0
NPM Published version (Latest)
4.5.1
NPM Package Name
@project-sunbird/client-services
NPM Link
Works
Across All JavaScript Based Projects
Overview
The library is grouped into Modules and SubModules as shown below -
The public facing API is prefixed with 'Cs' namespace, as in -
CsModule
CsConfig
CsGroupService
...
For instance,
CsModule is part of the root module
CsContentsGroupGenerator is a utlility within content service
Their respective imports would be -
import {CsModule} from "@project-sunbird/client-services";
import {CsContentsGroupGenerator} from "@project-sunbird/client-services/services/content/utilities/content-group-generator";
Installation
To install the package
npm i @project-sunbird/client-services@3.x.x
Getting Started
To use the library CsModule, it needs to be initialised with basic configuration. CsModule is a singleton and it would be best to check if it has already been initialised before attempting to initialise -
If the client for the library is a cordova project, use the 'HttpClientCordovaAdapter' adapter or use 'HttpClientBrowserAdapter'. 'HttpClientBrowserAdapter' is the default if not specified.
Update Configuration
The configuration can be dynamically reset after initialisation