A sample business system built with Meteor and the Smooch API.
Intended use: This code is a proof of concept and is not meant to be used in production. It should be used as a reference only to create your own implementation.
- Install meteor
curl https://install.meteor.com/ | sh
- Clone this thing
git clone https://github.com/smooch/smooch-desk.git
-
In the smooch-desk directory, run
npm install
andmeteor npm install
-
Configure a webhook:
Configure a Smooch webhook to send "All Triggers" to your smoochDesk app at the "/hook" route
- Configure your secret keys and appId
You'll need a managed account secret key which you can obtain from https://app.smooch.io/account. The key ID should have a act_
prefix.
Using the settings.json.example file as a guide, create a settings.json file that contains your appId, secret key, key ID, and appId. You can find the appId by looking at the identifier in the URL shown in your browser's address bar when you are viewing a Smooch app (ex: https://app.smooch.io/apps/APP_ID/overview
)
- Run it:
meteor --settings settings.json
You can visit "/web-messenger" to send test messages as an end-user
This project's structure and UI is based on work done by [@timbrandin] as part of his Meteor Slack project. Substantial changes have been made since to repurpose the project for use as a Smooch "business system" example. As such, this code is made available under the GPL.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Comment:
find server client -not \( -path client/compatibility -prune \) -type f -name '*.js' -print0 | xargs -0 sed -i '' 's/\(\/\*\*.*\*\/$\)/\1\/\*/g'
Uncomment:
find server client -not \( -path client/compatibility -prune \) -type f -name '*.js' -print0 | xargs -0 sed -i '' 's/\(\/\*\*.*\)\/\*$/\1/g'