Skip to content

thrownew/go-sumsub

Repository files navigation

Release License Godocs

Build Status codecov Go Report Card

go-sumsub

SumSub API client for Go.

Installation

go get github.com/thrownew/go-sumsub

Documentation

https://docs.sumsub.com/docs/overview https://docs.sumsub.com/reference/about-sumsub-api

Supported endpoints

Feel free to open an issue or PR if you need more endpoints.

Usage

package main

import (
    "context"
    "fmt"
    "time"

	sumsub "github.com/thrownew/go-sumsub"
)

func main() {
	cli := sumsub.NewClient(
		"api_token",
		sumsub.NewHMACSigner("api_secret"),
	)
	
	err := cli.Health(context.Background())
	if err != nil {
		panic(fmt.Errorf("health: %w", err))
	}

	resp, err := cli.GenerateAccessTokenSDK(context.Background(), sumsub.GenerateAccessTokenSDKRequest{
		TTL:       time.Minute,
		UserID:    "1000",
		LevelName: "default-level",
	})
	if err != nil {
		panic(fmt.Errorf("generate access token sdk: %w", err))
	}
	fmt.Println("Token: ", resp.Token)
}

About

Golang library to work with sum&sub API

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages