Simple, idiomatic Go client for Smile ID server-side products i.e Basic KYC, Enhanced KYC, Document Verification and Phone Number Verification.
To start using the SDK in your Go project, run;
go get github.com/Salaton/smile-identityOptionally, you can supply the base URL, APIKey, PartnerID and CallbackURL via environment variables. The following environment variables are recognized
SMILE_ID_API_KEY
SMILE_ID_PARTNER_ID
SMILE_ID_BASE_URL
SMILE_ID_CALLBACK_URLThis allows you to create a client with zero arguments;
client, err := smile.NewClientFromEnvVars()
if err != nil{
// handle error
}If you prefer to supply the values manually;
client, err := smile.NewClient(smile.Config{
APIKey: os.Getenv("SMILE_API_KEY"),
PartnerID: os.Getenv("SMILE_PARTNER_ID"),
BaseURL: "https://api.smileidentity.com/v1",
CallbackURL: "https://example.com/webhook",
})
if err != nil{
// handle err
}Below is a simple example showing how you can run a basic kyc request
package main
import (
"context"
"fmt"
"log"
smile "github.com/Salaton/smile-identity"
)
func main() {
// 1. Configure the client once at start-up
client, err := smile.NewClient(smile.Config{
APIKey: os.Getenv("SMILE_API_KEY"),
PartnerID: os.Getenv("SMILE_PARTNER_ID"),
BaseURL: "https://api.smileidentity.com/v1",
CallbackURL: "https://example.com/webhook",
})
if err != nil{
// handle err
}
// 2. Build your request (Basic KYC example)
req := smile.BasicKYCRequest{
Country: "KE",
IDType: smile.NATIONAL_ID,
IDNumber: "12345678901",
FirstName: "John",
LastName: "Doe",
DOB: "1994-07-13",
}
// 3. Send the job & handle the response
resp, err := client.BasicKYCVerification(context.Background(), req)
if err != nil {
log.Fatalf("kyc failed: %v", err)
}
}We use release-please to manage our releases. This tool automates the process of creating a pull request with the next semantic version, updating the CHANGELOG, and tagging a release