Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.15 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.15 KB

GoDoc

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:

  1. 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.
  2. secretkey: This is your webhook shared secret key used to validate whether incoming signatures from webhooks are valid.