Fraud SDK Go module v2.0.0
September 17th, 2026 by ReadMe API
Breaking changes
- Refactor the SDK as a client generated from the Account Protect OpenAPI specification, replacing the previous hand-written implementation
- Update the module path from
github.com/datadome/fraud-sdk-gotogithub.com/datadome/fraud-sdk-go/v2 - Update event submission to one dedicated struct per operation (e.g.
ValidateLogin,CollectCustom,Feedback) instead of theEventinterface and theClient.Validate/Client.Collectmethods - Update payload construction to functional options passed to per-operation constructors (e.g.
NewValidateLogin(account, status, opts...)) instead of the previous per-event builders - Update payload validation to run at construction time and fail on missing required fields instead of being silently accepted
- Update request execution to a
PerformOperation(ctx, client, request, requestMetadata)method on each operation, now requiring an explicitcontext.Context, replacingValidate,ValidateWithRequestMetadata,Collect, andCollectWithRequestMetadata - Update error handling so collect and feedback calls return a Go
error(including the newHTTPErrortype and decoded API errors) instead of anErrorResponsePayloadwith aStatusfield, while validate calls still fail open and return anallowaction - Rename
ResponsePayload,SuccessResponsePayload, andErrorResponsePayloadtoResponse,ResponseLogin, andError, remove theStatusfield, and uppercase theResponseActionconstants (Allow->ALLOW,Deny->DENY,Review->REVIEW,Challenge->CHALLENGE) - Rename
LoginStatustoLoginPayloadStatusand itsFailed/Succeededconstants toLoginPayloadStatusFailed/LoginPayloadStatusSucceeded
Other changes
- Add support for the feedback endpoint with
NewFeedback

