Skip to content

EddyTravels/smooch

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

cffba98 · Nov 11, 2019

History

15 Commits
Jun 28, 2019
Nov 8, 2019
Apr 24, 2019
Nov 8, 2019
Apr 24, 2019
Apr 24, 2019
Nov 11, 2019
Nov 11, 2019
Nov 8, 2019
Apr 24, 2019
Nov 11, 2019
Jun 28, 2019
Jun 28, 2019
Apr 26, 2019

Repository files navigation

Smooch

This is a Go library for making bots with Smooch service.

Note : This a modified version version of EddyTravels/smooch library with additional features. Please refer to the original repo for the original features.

Additional Feature

  • Token expiration & its checking.
  • Renew token functionality whenever token is expired.
  • Redis support as a centralized storage to store JWT token for supporting autoscaling environment. Use redigo as redis library.

Tips

Smooch documentation: https://docs.smooch.io/rest/

Installing

$ go get -u github.com/kitabisa/smooch

Example

import (
	"os"

	"github.com/kitabisa/smooch"
)

func main() {
    smoochClient, err := smooch.New(smooch.Options{
        AppID:        os.Getenv("SMOOCH_APP_ID"),
        KeyID:        os.Getenv("SMOOCH_KEY_ID"),
        Secret:       os.Getenv("SMOOCH_SECRET"),
        VerifySecret: os.Getenv("SMOOCH_VERIFY_SECRET"),
        RedisPool:    redisPool,
    })

    if err != nil {
        panic(err)
    }
}

Contributing

You are more than welcome to contribute to this project. Fork and make a Pull Request, or create an Issue if you see any problem.