Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.3 KB

README.md

File metadata and controls

35 lines (26 loc) · 1.3 KB

slackauth

godoc reference Build Status codecov License

slackauth is a package to implement the "Add to Slack" button functionality in an easy way.

Install

go get gopkg.in/mvader/slackauth.v1

Example

service, err := slackauth.New(slackauth.Options{
	Addr:         ":8080",
	ClientID:     os.Getenv("CLIENT_ID"),
	ClientSecret: os.Getenv("CLIENT_SECRET"),
	SuccessTpl:   "success.html",
	ErrorTpl:     "error.html",
	Debug:        true,
})
if err != nil {
	log.Fatal(err)
}

service.OnAuth(func(auth *slack.OAuthResponse) {
	log15.Info("someone was authorized!", "team", auth.TeamName)
})

log.Fatal(service.Run())

See full example in the examples folder.