npm install woveon-sdk --save
import woveonSdk from 'woveon-sdk';
const sdk = woveonSdk(CUSTOM_HOST, CUSTOM_APPID, CUSTOM_APPSECRET);
sdk.setHandlers({
createPost: CUSTOM_CREATEPOST_HANDLER,
updatePost: CUSTOM_UPDATEPOST_HANDLER,
deletePost: CUSTOM_DELETEPOST_HANDLER,
createComment: CUSTOM_CREATECOMMENT_HANDLER,
updateComment: CUSTOM_UPDATECOMMENT_HANDLER,
deleteComment: CUSTOM_DELETECOMMENT_HANDLER,
toogleLike: CUSTOM_TOOGLELIKE_HANDLER
}
All the strings are not limited by length. Although total size of data sent must not oversize 50mb.
sdk.waveonSdk.post.create({
token: CUSTOM_TOKEN,
author: CUSTOM_AUTHOR,
authorUrl:CUSTOM_AUTHORURL,
postId: CUSTOM_POSTID,
subject: CUSTOM_SUBJECT,
message: CUSTOM_MESSAGE,
});
CUSTOM_TOKEN
type: string
description: Token which is used to contact channel
CUSTOM_AUTHOR
type: string
description: Author's name (is displayed on a page)
CUSTOM_AUTHORURL
type: string
description: Author's avatar address (is displayed on a page)
CUSTOM_POSTID
type: string
description: Post unique ID
CUSTOM_SUBJECT
type: string
description: Post header
CUSTOM_MESSAGE
type: string
description: Post text
*success*
type: boolean
description: Marker that indicates operation status (e.g. successful)
sdk.waveonSdk.post.update({
token: CUSTOM_TOKEN,
postId: CUSTOM_POSTID,
subject: CUSTOM_SUBJECT,
message: CUSTOM_MESSAGE,
});
CUSTOM_TOKEN
type: string
description: Token which is used to contact channel
CUSTOM_POSTID
type: string
description: Post unique ID
CUSTOM_SUBJECT
type: string
description: Post header
CUSTOM_MESSAGE
type: string
description: Post text
*success*
type: boolean
description: Marker that indicates operation status (e.g. successful)
sdk.waveonSdk.post.update({
token: CUSTOM_TOKEN,
postId: CUSTOM_POSTID
});
CUSTOM_TOKEN
type: string
description: Token which is used to contact channel
CUSTOM_POSTID
type: string
description: Post unique ID
*success*
type: boolean
description: Marker that indicates operation status (e.g. successful)
sdk.waveonSdk.post.create({
token: CUSTOM_TOKEN,
author: CUSTOM_AUTHOR,
authorUrl:CUSTOM_AUTHORURL,
postId: CUSTOM_POSTID,
commentId: CUSTOM_COMMENTID,
message: CUSTOM_MESSAGE,
});
CUSTOM_TOKEN
type: string
description: Token which is used to contact channel
CUSTOM_AUTHOR
type: string
description: Author's name (is displayed on a page)
CUSTOM_AUTHORURL
type: string
description: Author's avatar address (is displayed on a page)
CUSTOM_POSTID
type: string
description: Post unique ID
CUSTOM_COMMENTID
type: string
description: Commentary unique ID
CUSTOM_MESSAGE
type: string
description: Commentary text
*success*
type: boolean
description: Marker that indicates operation status (e.g. successful)
sdk.waveonSdk.post.update({
token: CUSTOM_TOKEN,
commentId: CUSTOM_COMMENTID,
message: CUSTOM_MESSAGE,
});
CUSTOM_TOKEN
type: string
description: Token which is used to contact channel
CUSTOM_COMMENTID
type: string
description: Commentary unique ID
CUSTOM_MESSAGE
type: string
description: Commentary text
*success*
type: boolean
description: Marker that indicates operation status (e.g. successful)
sdk.waveonSdk.post.update({
token: CUSTOM_TOKEN,
commentId: CUSTOM_COMMENTID
});
CUSTOM_TOKEN
type: string
description: Marker that indicates operation status (e.g. successful)
CUSTOM_COMMENTID
type: string
description: Commentary unique ID
*success*
type: boolean
description: Marker that indicates operation status (e.g. successful)
sdk.waveonSdk.like.update({
token: CUSTOM_TOKEN,
postId: CUSTOM_POSTID,
author: CUSTOM_AUTHOR,
authorUrl:CUSTOM_AUTHORURL
});
CUSTOM_TOKEN
type: string
description: Token which is used to contact channel
CUSTOM_POSTID
type: string
description: Commentary or Post unique ID
CUSTOM_AUTHOR
type: string
description: Author's name (is displayed on a page)
CUSTOM_AUTHORURL
type: string
description: Author's avatar address (is displayed on a page)
*success*
type: boolean
description: Marker that indicates operation status (e.g. successful)
User performs some action, eg. creates commentary. Server side sends data to some application. Listener awaits for those data.
const listener = (...args) => {
return sdk.hookMethod(args);
}