Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 991 Bytes

README.md

File metadata and controls

38 lines (27 loc) · 991 Bytes

go-trustpilot

Trustpilot API client library for Go.

ci GoDoc

This library does not implement full Trustpilot API.

Getting Started

The client library can be configured using ClientOption as functional options.

func ExampleNewClient() {
	authConfig := &trustpilot.PasswordGrantConfig{
		ClientID:     "1a9SsZ2XJKraw1Prl8m+gvq",
		ClientSecret: "AxLoJhlAcbWiVA8cHW2fINep",
		Username:     "apiuser@example.com",
		Password:     "6X2hQa1lPHu9dVjikUr0FbRt",
	}

	client, err := trustpilot.NewClient(
		trustpilot.AuthConfig(authConfig),
		trustpilot.Debug(true),
	)

	if err != nil {
		// TODO handle the error.
	}

	_ = client
}

Authentication

This client supports Trustpilot's oauth 2.0 password grant type. Other Trustpilot-supported grant types may be added.