Introduction to the JavaScript Service Provider

The JavaScript Service Provider (JSSP) allows you to generate new service types for K2 Cloud that appear alongside native service types already available in K2 Cloud environments. For example, K2 Cloud provides a service type that allows you to expose an Azure SQL database as SmartObjects. If you want to integrate with another technology that K2 Cloud does not provide an out-of-the-box connector for, you could use one of the generic service types (such as the REST Service Type) to integrate with the API exposed by the target system, or you could use JavaScript to write your own custom service type to integrate with the target system's API.

While using one of the generic service types does not require you to write any code, writing your own service type with the JSSP allows you full control over the behavior of the service type, and allows you more control over any processing that needs to happen when translating objects, properties and methods between K2 and the target system. As opposed to the generic service types, the JSSP does not require you to serialize inputs and deserialize payloads like you have to do with the endpoint brokers, and particularly the REST broker. With the JSSP, you can handle all payload processing using JavaScript, giving you the flexibility to represent SmartObjects as the business objects that your business or customer understands and can more easily use in their solutions, without the added complexity of serialization and deserialization.

To learn more about the concepts and architecture of custom service types with JSSP in K2, see the topic Understanding Service Types, Service Objects and Architecture.

To get started with creating custom JSSP service types, see the topics Setting up your development environment and Understanding JavaScript Service Provider project structure. You can also refer to the available JSSP Sample Projects to see how to approach building a custom JSSP service type.