Skip to content

Releases: getyoti/yoti-go-sdk

v3.16.0

23 Feb 08:05
897ec7a

Choose a tag to compare

Add Support for Retrieving SHARE_CODE Resources in IDV Sessions

Overview

This version implements support for retrieving the new SHARE_CODE resource type from IDV session data. Share codes are managed server-side by the API — the SDK provides read access to share code resources returned in session retrieval responses.

Changes

Session Retrieval (Response)

  • Resource Response: Created ShareCodeResourceResponse with support for:
    • Basic fields: id, source, created_at, last_updated
    • Media fields via ShareCodeMediaResponse wrapper: lookup_profile, returned_profile, id_photo, file
    • Polymorphic source unmarshalling — handles both string ("END_USER") and object ({"type":"END_USER"}) formats
    • Tasks array with automatic filtering for VERIFY_SHARE_CODE_TASK
  • Task Response: Added VerifyShareCodeTaskResponse for handling VERIFY_SHARE_CODE_TASK type
  • Resource Container: Updated to include ShareCodes field ([]*ShareCodeResourceResponse)

SDK Config Improvements

  • AllowHandOff serialization fix: Added custom MarshalJSON on SDKConfig so allow_handoff: false is correctly emitted when explicitly set via the builder, while preserving omitempty behaviour for direct struct construction
  • Keyed struct literal: Converted Build() from positional to keyed literal for resilience to future struct changes

Constants

  • Added VerifyShareCodeTask = "VERIFY_SHARE_CODE_TASK" constant

Other

  • Updated .golangci.yml for golangci-lint v2 compatibility
  • Updated .pre-commit-config.yaml hook args
  • Updated SDK version to 3.16.0

API Usage

Retrieving Share Codes from a Session

result, err := client.GetSession(sessionID)

for _, sc := range result.Resources.ShareCodes {
    fmt.Println("ID:", sc.ID)
    fmt.Println("Source:", sc.Source)
    fmt.Println("Created:", sc.CreatedAt)

    if sc.IDPhoto != nil && sc.IDPhoto.Media != nil {
        fmt.Println("ID Photo Media ID:", sc.IDPhoto.Media.ID)
    }

    for _, task := range sc.VerifyShareCodeTasks() {
        fmt.Println("Task:", task.ID, "State:", task.State)
    }
}

v3.15.0

25 Nov 08:27
1bb7a8d

Choose a tag to compare

Added

SDK-2652: Implement SDK Helper Methods for Digital ID Estimated Age Attribute

🎯 Overview

This PR implements comprehensive helper methods for requesting the estimated_age attribute with automatic fallback to date_of_birth from Digital ID app shares. The implementation includes buffer support for enhanced age verification accuracy and maintains full backward compatibility.

✨ What's New

Core SDK Features

Policy Builder Helper Methods

Added to both digitalidentity and dynamic packages:

  • WithEstimatedAge() - Request estimated age with automatic date_of_birth fallback
  • WithEstimatedAgeOver(age, buffer) - Age verification with configurable buffer
  • WithEstimatedAgeUnder(age, buffer) - Age under verification with buffer
  • WithEstimatedAgeOverSimple(age) - Backward compatible (no buffer)
  • WithEstimatedAgeUnderSimple(age) - Backward compatible (no buffer)

User Profile Helper Methods

Added to both digitalidentity and profile packages:

  • EstimatedAge() - Returns estimated_age attribute if present
  • EstimatedAgeWithFallback() - Returns estimated_age or falls back to date_of_birth

Buffer Functionality

Age Derivation Format: age_over:age:buffer (e.g., age_over:18:5)

Smart Logic:

  • estimated_age attribute checks for age + buffer (e.g., 23)
  • date_of_birth fallback checks for exact age (e.g., 18)

Example: For age 18 with 5-year buffer:

policy, err := (&digitalidentity.PolicyBuilder{}).
    WithEstimatedAgeOver(18, 5).
    Build()

v3.14.0

12 Jun 08:15
84a18a5

Choose a tag to compare

Added

  • Face Comparison, face capture resource, get session config,
  • Face-Capture Controller ( can be examined to understand example flow)

Expanded SharedReceiptResponse to include details about the error:

Before:

type SharedReceiptResponse struct {
	ID                 string
	SessionID          string
	RememberMeID       string
	ParentRememberMeID string
	Timestamp          string
	Error              string
	UserContent        UserContent
	ApplicationContent ApplicationContent
}

After:

type SharedReceiptResponse struct {
	ID                 string
	SessionID          string
	RememberMeID       string
	ParentRememberMeID string
	Timestamp          string
	Error              string
	ErrorReason        ErrorReason
	UserContent        UserContent
	ApplicationContent ApplicationContent
}

type ErrorReason struct {
	RequirementsNotMetDetails []RequirementsNotMetDetail `json:"requirements_not_met_details"`
}

type RequirementsNotMetDetail struct {
	Details                string `json:"details"`
	AuditId                string `json:"audit_id"`
	FailureType            string `json:"failure_type"`
	DocumentType           string `json:"document_type"`
	DocumentCountryIsoCode string `json:"document_country_iso_code"`
}

v3.13.0

27 Mar 14:13
54e6d51

Choose a tag to compare

Added

Update session config to configure consent screen location
Add failure reason info to IDV Get session results
Support Brand ID in session config
Support dark mode in IDV SDK

v3.12.0

28 Feb 14:46
b3f3dab

Choose a tag to compare

Added

Support for Share V2 Create Session
Support for Share V2 Retrieve Session
Support for Share V2 Create Qr Code
Support for Share V2 Retrieve Qr Code
Support for Share V2 Retrieve Receipt
Support for advanced identity profiles to Share V2 and examples

Please view digitalidentity project under _examples folder

v3.11.0

14 Nov 11:31
7c9c611

Choose a tag to compare

Added

  • Support for enable/disable mobile handoff

Example:

sdkConfig, err := NewSdkConfigBuilder().WithAllowHandOff(true).Build()
  • Support for advanced identity profile requirements for idv and share v1.

Example:

advancedIdentityProfile := []byte(`{
		"profiles": [
			{
				"trust_framework": "YOTI_GLOBAL",
				"schemes": [
					{
						"label": "LB321",
						"type": "IDENTITY",
						"objective": "AL_L1"
					}
				]
			}
		]
	}`)

// For share v1 dynamic scenario
policy, err := (&dynamic.PolicyBuilder{}).
	WithAdvancedIdentityProfileRequirements(advancedIdentityProfile).
	Build()
if err != nil {
	return err
}

scenario, err := (&dynamic.ScenarioBuilder{}).WithPolicy(policy).Build()
if err != nil {
	return err
}

// For idv
sessionSpec, err := create.NewSessionSpecificationBuilder().
	WithAdvancedIdentityProfileRequirements(advancedIdentityProfile).
	WithCreateIdentityProfilePreview(true).
	Build()
if err != nil {
	return err
}

v3.10.0

28 Jun 15:02

Choose a tag to compare

Added

  • Support for NonLatin Documents and Allow Expired Documents feature for Document Restrictions

Requested with

docRestriction, err := filter.NewRequestedDocumentRestrictionBuilder().
		WithDocumentTypes([]string{"PASSPORT"}).
		WithCountryCodes([]string{"GBR"}).
		Build()
	if err != nil {
		return nil, err
	}

	docFilter, err := filter.NewRequestedDocumentRestrictionsFilterBuilder().
		ForIncludeList().
		WithDocumentRestriction(docRestriction).
		WithAllowNonLatinDocuments(true).
		WithExpiredDocuments(false).
		Build()
	if err != nil {
		return nil, err
	}
  • Added Expanded Document Fields Feature
var textExtractionTask *task.RequestedTextExtractionTask
	textExtractionTask, err = task.NewRequestedTextExtractionTaskBuilder().
		WithManualCheckAlways().
		WithExpandedDocumentFields(true).
		Build()
	if err != nil {
		return nil, err
	}

Example available when running the idv example project at https://localhost:8080

v3.9.0

06 Feb 13:54
650b910

Choose a tag to compare

Added

  • ImportToken to Session Specification Builder and a ImportTokenBuilder

Requested with

ttl := time.Hour * 24 * 30
importToken, err := create.NewImportTokenBuilder().
	WithTTL(int(ttl.Seconds())).
	Build()
if err != nil {
	return nil, err
}

sessionSpec, err = create.NewSessionSpecificationBuilder().
		WithClientSessionTokenTTL(6000).
		WithResourcesTTL(900000).
		WithUserTrackingID("some-tracking-id").
		WithSDKConfig(sdkConfig).
		WithIdentityProfileRequirements(identityProfile).
		WithCreateIdentityProfilePreview(true).
		WithSubject(subject).
                WithImportToken(importToken).
		Build()
  • ImportTokenResponse to IDV GetSessionResult:
getSessionResult, err := client.GetSession(sessionId)
if err != nil {
        return err
}
importTokenResponse := getSessionResult.ImportTokenResponse

Example available when running the idv example project at https://localhost:8080/dbs

v3.7.0

07 Dec 15:46
b1b6d24

Choose a tag to compare

IDV

Added

  • Identity Profile Requirements to Session Specification Builder

Requested With

identityProfile := []byte({
		"trust_framework": "UK_TFIDA",
		"scheme": {
			"type":      "DBS",
			"objective": "STANDARD"
		}
	})

	sessionSpec, err = create.NewSessionSpecificationBuilder().
		WithClientSessionTokenTTL(600).
		WithResourcesTTL(90000).
		WithUserTrackingID("some-tracking-id").
		WithSDKConfig(sdkConfig).
		WithIdentityProfileRequirements(identityProfile).
		Build()

Example available when running the idv example project at https://localhost:8080/dbs

Added

  • IdentityProfile to IDV GetSessionResult:
getSessionResult, err := client.GetSession(sessionId)
if err != nil {
        return err
}
identityProfile := getSessionResult.IdentityProfileResponse
subjectId := identityProfile.SubjectId
result := identityProfile.Result
failureReasonCode := identityProfile.FailureReasonResponse.ReasonCode

example IdentityProfile.Report value:

"trust_framework": "UK_TFIDA",
"schemes_compliance": [{
		"scheme": {
			"type": "DBS",
			"objective": "STANDARD"
		},
		"requirements_met": true,
		"requirements_not_met_info": "info here"
	}
],
"media": {
	"id": "c69ff2db-6caf-4e74-8386-037711bbc8d7",
	"type": "IMAGE",
	"created": "2022-03-29T11:39:24Z",
	"last_updated": "2022-03-29T11:39:24Z"
}

MediaID can be retrieved with:

media := result.IdentityProfileResponse.Report["media"].(map[string]interface{})
mediaId := media["id"].(string)

and used to retrieve the full identity profile report as JSON with a separate call:

mediaValue, err := client.GetMediaContent("your-session-id", mediaId)

Added

  • Subject to IDV request

requested with:

	subject := []byte(`{
		"subject_id": "subject ID"
	}`)

	sessionSpecification, err := NewSessionSpecificationBuilder().
		WithSubject(subject).
		Build()

example of Session Result containing the subject_id specified when the session was crated:

{
  "session_id": "a1746488-efcc-4c59-bd28-f849dcb933a2",
  "client_session_token_ttl": 599,
  "user_tracking_id": "user-tracking-id",
  "biometric_consent": "2022-03-29T11:39:08.473Z",
  "state": "COMPLETED",
  "client_session_token": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "identity_profile": {
    "subject_id": "subject ID",
    "result": "DONE",
    "failure_reason": {
      "reason_code": "MANDATORY_DOCUMENT_COULD_NOT_BE_PROVIDED"
    },
    "identity_profile_report": {
      "trust_framework": "UK_TFIDA",
      "schemes_compliance": [{
        "scheme": {
          "type": "DBS",
          "objective": "STANDARD"
        },
        "requirements_met": true,
        "requirements_not_met_info": "some string here"
      }],
      "media": {
        "id": "c69ff2db-6caf-4e74-8386-037711bbc8d7",
        "type": "IMAGE",
        "created": "2022-03-29T11:39:24Z",
        "last_updated": "2022-03-29T11:39:24Z"
      }
    }
  }
}

Added
WithIdDocumentTextExtractionCategoryAttempts, WithIdDocumentTextExtractionReclassificationAttempts, WithIdDocumentTextExtractiongenericAttempts to the SdkConfig

sdkConfig, err := NewSdkConfigBuilder().
	WithIdDocumentTextExtractionGenericAttempts(3).
	WithIdDocumentTextExtractionCategoryAttempts("CATEGORY", 2).
	WithIdDocumentTextExtractionReclassificationAttempts(2).
	Build()

Added

  • IdentityProfilePreview to Session Specification Builder

Requested with

sessionSpec, err = create.NewSessionSpecificationBuilder().
		WithClientSessionTokenTTL(6000).
		WithResourcesTTL(900000).
		WithUserTrackingID("some-tracking-id").
		WithSDKConfig(sdkConfig).
		WithIdentityProfileRequirements(identityProfile).
		WithCreateIdentityProfilePreview(true).
		WithSubject(subject).
		Build()
  • IdentityProfilePreview to IDV GetSessionResult:
getSessionResult, err := client.GetSession(sessionId)
if err != nil {
        return err
}
identityProfilePreview := getSessionResult.IdentityProfilePreview

Example available when running the idv example project at https://localhost:8080/dbs

v3.6.0

12 Jul 09:31
ffeaaf8

Choose a tag to compare

Profile

Added

  • UserProfile
    • GetAttributeByID
    • GetSelfieAttributeByID
    • GetDocumentImagesAttributeByID
    • Identity Profile Report attribute:
var identityProfileReportValue map[string]interface{} = userProfile.IdentityProfileReport().Value() // JSON

See examples for usage

  • Generate Identity Scheme (DBS/RTW/RTR) QR code with:
identityProfile := []byte(`{
	"trust_framework": "UK_TFIDA",
	"scheme": {
		"type":      "DBS",
		"objective": "BASIC"
	}
}`)

policy, err := (&dynamic.PolicyBuilder{}).
	WithIdentityProfileRequirements(identityProfile).
	Build()
if err != nil {
	return err
}

subject := []byte(`{
	"subject_id": "my_subject_id"
}`)
scenario, err := (&dynamic.ScenarioBuilder{}).
	WithPolicy(policy).
	WithSubject(subject).
	WithCallbackEndpoint(yourEndpoint).Build()

IDV

Added

  • Watchlist Screening Check
watchlistScreeningCheck, err := NewRequestedWatchlistScreeningCheckBuilder().
		WithAdverseMediaCategory().
		WithSanctionsCategory().
		Build()
  • Advanced CA Check
advancedCAYotiAccountCheck, err := check.NewRequestedWatchlistAdvancedCACheckYotiAccountBuilder().
	WithRemoveDeceased(true).
	WithShareURL(true).
	WithSources(check.RequestedTypeListSources{
		Types: []string{"pep", "fitness-probity", "warning"}}).
	WithMatchingStrategy(check.RequestedFuzzyMatchingStrategy{Fuzziness: 0.5}).
	Build()

OR

advancedCACustomAccountCheck, err := check.NewRequestedWatchlistAdvancedCACheckCustomAccountBuilder().
	WithAPIKey("api-key").
	WithMonitoring(true).
	WithTags(map[string]string{
		"tag_name": "value",
	}).
	WithClientRef("client-ref").
	WithMatchingStrategy(check.RequestedExactMatchingStrategy{ExactMatch: true}).
	Build()

Response retrieved with:

getSessionResult.WatchlistScreeningChecks()
getSessionResult.WatchlistAdvancedCAChecks()