Install & configure
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.