@scrbbl/scribblelive-toolkit-commenting v0.0.10
ScribbleLive Toolkit Commenting Module
The ScribbleLive Toolkit Commenting Module allows you to post text and image comments on ScribbleLive streams.
Installing Node and NPM
Install Node and NPM from https://nodejs.org/en/download/
Setup
From the project directory run:
npm install
Then to setup the test project:
npm run build-test-project
Now you can open /test-project/dist/index.html in your browser and post some comments!
Using the Commenting module
To create an instance of the commenting module:
import Commenting from '@scrbbl/scribblelive-toolkit-commenting';
const commentingModule = new Commenting({ token: 'my-token' });
Post a text comment:
commentingModule.addTextComment({
auth: 'my-auth',
threadId: 123456,
content: 'This is a comment!',
})
Post an image comment:
commentingModule.addImageComment({
auth: 'my-auth',
threadId: 123456,
image: { }, // Image file
caption: 'This is an image caption!',
})
Methods
Commenting constructor({ string token, string baseUrl (optional) })
The constructor takes an object containing the API key token and an optional base URL (the default is https://apigateway.scribblelive.com) and returns a new instance of Commenting (the commenting module).
Promise addTextComment({ string auth, string threadId, string content })
Adds a new text comment to the stream with the given threadId.
Promise addImageComment({ string auth string threadId, File image, string caption (optional) })
Adds a new image comment to the stream with the given threadId. The caption is optional.