Skip to main content

Server SDKs for v4 API coming soon

We are working on new major versions of all our SDKs. If you need to use this integration, please use the v3 API instead or generate your own from the Server API OpenAPI schema.

How to install

Get the package from GitHub using go get.
Bash
go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk
Initialize the client instance and use it to make API requests. You need to specify your secret API key and region (if it is not US/Global).
Go
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, "<requestId>")
  if eventErr != nil {
    log.Fatal(eventErr)
  }
  fmt.Printf("Event: %s", event, eventHttpRes)
}

Documentation

You can find the full documentation in the official GitHub repository. The repository also contains an example app demonstrating the usage of the library.