1.0.0-alpha.98 • Published 1 month ago

@tenfold/client-sdk v1.0.0-alpha.98

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 month ago

Tenfold Client SDK

This repo contains typescript types and definitions to help guiding client side integration development. As integrations will be developed as standalone typescript libraries, they will not have access to Tenfold's source code, and this SDK should act as a bridge between the two parties. The interfaces exposed here will provide information about the methods that expected by the Tenfold App, what parameters each method will receive and what is the return type expected for each.

One important thing to notice is that the types exposed by this repo is a mix of types that are exclusive to client integrations and types re-exported by other libraries. The reason for re-exporting them is to simplify development purpose and not force developers to add multiple libraries in your package json when only interested in type definitions.

The Client Integration Descriptor

The client integration descriptor is the core of the integration. The ClientIntegrationDescriptor type is what is exported by your library and represents the concrete instance that is consumed by the Tenfold app. It is the contract that is used by Tenfold App and the integration to talk to each other. While this section will not go into specific details of each method that needs to be implemented by the integration descriptor (you can see it in the JSDocs in the ClientIntegrationDescriptor itself), it will provide a high level overview of how the integration happens. In summary,

  • Tenfold App will use information about the user/customer using the app to know what integrations to instantiate
  • The integration will be dynamically loaded and will provide an instance of ClientIntegrationDescriptor
  • Tenfold App will create an instance of a container of dependencies and will invoke the optional method onBindDependencies in the integration to optionally bind more dependencies in the container (see the Dependency Injection section below)
  • Tenfold App will invoke the various methods of the integration descriptor with the relevant parameters, plus the injector created in the previous step

Dependency Injection

For details regarding Dependency Injection such as how to use it, what information is available out of the box in the projected injector, etc, see the dependency-injection guide.

Integration aspects

The integration being developed needs to take care of two fundamental aspects:

  • Passing commands from the Tenfold app over to the provider: This is handled by the adaptors that will be implemented by the integration. The methods on each adaptor will be invoked by the Tenfold App in different occasions with different parameters, and usually represent an action taken by the agent (such as an interaction control - answer, transfer, hangup, etc). See Adaptors for an in-depth explanation on how adaptors work and how they should behave

  • Passing incoming data from the provider to Tenfold: your integration code should handle any events published by the provider, transform those events by the formatted required by Tenfold and forward those events to the Tenfold App. See Events for a thorough explanation on that.

Other relevant aspects to keep in mind while creating your integration are:

  • It's important that the integration descriptor returned by your integration is the default export of the entry point of your package
  • Be mindful that your integration will be used in a front end context, which means that it will be downloaded in end-user's browser, so bundle sizes are very important. Be mindful of the dependencies you add in your library and keep an eye for libraries that can leverage on tree-shaking. A very good example is comparing lodash with lodash-es, where the later one can be tree-shaked and the first one can't.
  • As you develop your integration, please keep in mind error handling. The ask is to handle errors internally to the integration as best as possible, and convert integration errors to Tenfold Errors to give us most context possible about an error, with a type that can be directly consumed by Tenfold.

Client Integration example

For an example on how to use the client sdk, see https://github.com/tenfold/client-integration-template

1.0.0-alpha.98

1 month ago

1.0.0-alpha.97

2 months ago

1.0.0-alpha.96

4 months ago

1.0.0-alpha.95

7 months ago

1.0.0-alpha.94

7 months ago

1.0.0-alpha.92

12 months ago

1.0.0-alpha.93

11 months ago

1.0.0-alpha.91

1 year ago

1.0.0-alpha.90

1 year ago

1.0.0-alpha.87

1 year ago

1.0.0-alpha.89

1 year ago

1.0.0-alpha.88

1 year ago

1.0.0-alpha.86

1 year ago

1.0.0-alpha.85

1 year ago

1.0.0-alpha.84

1 year ago

1.0.0-alpha.83

1 year ago

1.0.0-alpha.78

1 year ago

1.0.0-alpha.77

1 year ago

1.0.0-alpha.79

1 year ago

1.0.0-alpha.81

1 year ago

1.0.0-alpha.80

1 year ago

1.0.0-alpha.82

1 year ago

1.0.0-alpha.69

2 years ago

1.0.0-alpha.74

1 year ago

1.0.0-alpha.73

2 years ago

1.0.0-alpha.76

1 year ago

1.0.0-alpha.75

1 year ago

1.0.0-alpha.70

2 years ago

1.0.0-alpha.72

2 years ago

1.0.0-alpha.71

2 years ago

1.0.0-alpha.63

2 years ago

1.0.0-alpha.65

2 years ago

1.0.0-alpha.64

2 years ago

1.0.0-alpha.67

2 years ago

1.0.0-alpha.66

2 years ago

1.0.0-alpha.68

2 years ago

1.0.0-alpha.62

2 years ago

1.0.0-alpha.61

2 years ago

1.0.0-alpha.54

2 years ago

1.0.0-alpha.59

2 years ago

1.0.0-alpha.56

2 years ago

1.0.0-alpha.55

2 years ago

1.0.0-alpha.58

2 years ago

1.0.0-alpha.57

2 years ago

1.0.0-alpha.60

2 years ago

1.0.0-alpha.52

2 years ago

1.0.0-alpha.53

2 years ago

1.0.0-alpha.51

2 years ago

1.0.0-alpha.50

2 years ago

1.0.0-alpha.49

2 years ago

1.0.0-alpha.48

2 years ago

1.0.0-alpha.45

2 years ago

1.0.0-alpha.47

2 years ago

1.0.0-alpha.46

2 years ago

1.0.0-alpha.38

2 years ago

1.0.0-alpha.39

2 years ago

1.0.0-alpha.41

2 years ago

1.0.0-alpha.40

2 years ago

1.0.0-alpha.43

2 years ago

1.0.0-alpha.42

2 years ago

1.0.0-alpha.44

2 years ago

1.0.0-alpha.37

2 years ago

1.0.0-alpha.34

2 years ago

1.0.0-alpha.33

2 years ago

1.0.0-alpha.36

2 years ago

1.0.0-alpha.35

2 years ago

1.0.0-alpha.32

3 years ago

1.0.0-alpha.31

3 years ago

1.0.0-alpha.30

3 years ago

1.0.0-alpha.29

3 years ago

1.0.0-alpha.28

3 years ago

1.0.0-alpha.27

3 years ago

1.0.0-alpha.26

3 years ago

1.0.0-alpha.25

3 years ago

1.0.0-alpha.24

3 years ago

1.0.0-alpha.23

3 years ago

1.0.0-alpha.22

3 years ago

1.0.0-alpha.21

3 years ago

1.0.0-alpha.19

3 years ago

1.0.0-alpha.20

3 years ago

1.0.0-alpha.18

3 years ago

1.0.0-alpha.17

3 years ago

1.0.0-alpha.16

3 years ago

1.0.0-alpha.15

3 years ago

1.0.0-alpha.14

3 years ago

1.0.0-alpha.12

3 years ago

1.0.0-alpha.13

3 years ago

1.0.0-alpha.10

3 years ago

1.0.0-alpha.11

3 years ago

1.0.0-alpha.8

3 years ago

1.0.0-alpha.7

3 years ago

1.0.0-alpha.6

3 years ago

1.0.0-alpha.5

3 years ago

1.0.0-alpha.4

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha.0

3 years ago