KJU JavaScript SDK
This is the official JavaScript Client for KJU, that runs on Node.js and in the Browser
The SDK comes with two APIs:
- A Client API, that implements all message oparations
- A Processing API, that is for automated message processing
For details about KJU, visit the KJU Website.
Install
npm
npm i kju-client
Browser
Example
// Initializekju = ; // Create a tokenkju // Create a messagekju kju
Client API
The kju JS client has the folllowing functions:
personalToken
Creates a personalToken
kju
createMessage
Creates a message
kju
permitCorrespondence
Permits a given sender to send further messages
kju
getMessage
Returns a single message by id
kju
deleteMessage
Delete a single message by id
kju
getMessages
Returns multiple messages that have the message Tag embedded in the consumer token
kju
redeemResponse
Redeems a response
kju
redeemResponseByLink
Redeems a response using the complete link
kju
Processing API
This Part of the API is for automated message processing. You can use this API to listen to messages and programatically redeem responses.
listenHttp
Creates an express server and listens for messages on a specified http endpoint. When this endpoint is set as reciever in a message, the message will be transmitted to the listener for further processing.
Message example
{
content: "blablalba",
reciever: "http://myendpoint.com"
}
Example Listener
kju