Go SFPY
The official SFPY Go client library.
Installation
Make sure your project is using Go Modules (it will have a go.mod
file in its root if it already is):
go mod init
Then, reference go-sfpy in a Go program with import
:
import (
"github.com/sfpyhub/go-sfpy/sfpy"
)
Run any of the normal go
commands (build
/install
/test
). The Go
toolchain will resolve and fetch the go-sfpy module automatically.
Alternatively, you can also explicitly go get
the package into a project:
go get -u "github.com/sfpyhub/go-sfpy/sfpy"
Initialize client
To use the SFPY client to make API requests, initialize it like so from within your service
client := sfpy.NewClient(apikey, secretkey)
NewClient
accepts two arguments:
apikey
: This is your SFPY Api key that is needed to authenticate all requests to the API. You can find this key on your dashboard.
secretkey
: This is your webhook shared secret key used to validate whether incoming signatures from webhooks are valid.