Skip to content

erizocosmico/slackauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Dead simple library to implement the "Add to Slack" button in Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages