How to install
Get the package from GitHub usinggo get.
Bash
Go
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
The Fingerprint Server Go SDK is an easy way to interact with our Server API from your Go application. You can retrieve visitor history or individual identification events. View our Go Server SDK quickstart for a step-by-step guide to get started.
go get.
go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk
package main
import (
"context"
"fmt"
"github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk"
"log"
)
func main() {
cfg := sdk.NewConfiguration()
client := sdk.NewAPIClient(cfg)
auth := context.WithValue(
context.Background(),
sdk.ContextAPIKey,
sdk.APIKey{Key: "SECRET_API_KEY"},
)
// cfg.ChangeRegion(sdk.RegionEU)
// Get visit history of a specific visitor
getVisitsOpts := sdk.FingerprintApiGetVisitsOpts{
Limit: 10,
}
visits, visitsHttpRes, visitsErr :=
client.FingerprintApi.GetVisits(auth, "<visitorId", &getVisitsOpts)
if visitsErr != nil {
log.Fatal(visitsErr)
}
fmt.Printf("Visitor history: %s", visits, visitsHttpRes)
// Get a specific identification event
event, eventHttpRes, eventErr :=
client.FingerprintApi.GetEvent(auth, "REQUEST_ID")
if eventErr != nil {
log.Fatal(eventErr)
}
fmt.Printf("Event: %s", event, eventHttpRes)
}
Was this page helpful?