@smart-moov/plugin
v1.1.4
Published
Base for Smart Moov plugins, available in the Smart Moov Marketplace
Downloads
3
Readme
Base ES6 classes to create Smart Moov plugins, to let you connect your product to our candidates.
A Smart Moov plugin let you to create custom chatbot steps, and synchronize applications with your APIs.
🚀 Getting started
Create your repository, with public access, with a index.js
file who exports an ES6 class extending our Plugin
class.
import { Plugin } from '@smart-moov/plugin'
export default class MyPlugin extends Plugin {}
✅ Features
You can enable features for your plugin :
export default class MyPlugin extends Plugin {
getFeatures () {
return ['chatbot', 'applications']
}
}
chatbot
: Let the plugin add chatbot steps, to directly interact with the candidate.applications
: Your plugin will be called whenever we receive an application from a candidate. This will let you send the application to an external API, etc
🤖 Chatbot integration
Add custom steps to the editor
export default class MyPlugin extends Plugin {
getChatbotStepConfiguration () {
return {
id: 'talk',
name: {
fr: 'Parler avec Dean',
en: 'Talk with Dean'
},
category: 'messages',
icon: 'comment-alt',
configuration: {
message: {
type: 'text',
i18n: true
}
}
}
}
}
More details soon.
Handle chatbot steps
export default class MyPlugin extends Plugin {
getChatbotPublicPlugin () {
return async ctx => {
const name = await ctx.askText('Question ?', {
minLength: 10
})
const ret = await ctx.callPrivatePlugin({
name
})
console.log(ret.saved)
}
}
async executeChatbotPrivatePlugin ({ name }, ctx) {
// Save name in other tools
return {
saved: true
}
}
}
More details soon.
🪝 Hooks
You can run methods on specific events :
export default class MyPlugin extends Plugin {
/**
* Called when the plugin is installed on an organization.
*/
onInstall (ctx) {
return undefined
}
/**
* Called when the plugin is uninstalled from an organization.
*/
onUninstall (ctx) {
return undefined
}
/**
* Called when the plugin configuration is saved.
*/
onSave (ctx) {
return undefined
}
}
More details soon.