Install & configure
The Go SDK is source-available on request and is not yet released: v2
has no tagged version and is not published to a module proxy, so go get
against the module path below will not resolve until it is. It covers OCR,
face, liveness and sessions; fraud detection and verification sessions are
not in it. Server-side integrations that need those today should call the
REST API directly or use the JavaScript SDK.
go get
go get github.com/cloudbhutan/ekyc-sdk-go/v2
Note the /v2 module path suffix — required by Go's
module versioning rules.
Construct a client
import (
"os"
ekyc "github.com/cloudbhutan/ekyc-sdk-go/v2"
)
func main() {
client, err := ekyc.NewClient(ekyc.Config{
BaseURL: "https://api.drukverify.com",
APIKey: os.Getenv("EKYC_SECRET_KEY"),
})
if err != nil {
log.Fatal(err)
}
// use client
}
NewClient validates the APIKey prefix immediately. An unrecognized
prefix returns an error before any network call — fail-fast on
misconfiguration.
Recommended: env-var pattern
Don't hard-code the secret. Read from env:
APIKey: os.Getenv("EKYC_SECRET_KEY"),
Set in your runtime environment via Doppler / Vault / SSM / docker-compose.
Where this code runs
The Go SDK is server-side. The dv_sk_* is a credential like a
database password — never embed it in a binary you ship to end users.
If you need to authenticate from a mobile or browser client, use the
Sessions.Create helper to mint a short-lived
dv_tok_* and ship that to the client instead.