Sift 0.8.0-beta

This is a prerelease version of Sift.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Sift --version 0.8.0-beta                
NuGet\Install-Package Sift -Version 0.8.0-beta                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sift" Version="0.8.0-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sift --version 0.8.0-beta                
#r "nuget: Sift, 0.8.0-beta"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Sift as a Cake Addin
#addin nuget:?package=Sift&version=0.8.0-beta&prerelease

// Install Sift as a Cake Tool
#tool nuget:?package=Sift&version=0.8.0-beta&prerelease                

sift-dotnet

Nuget (with prereleases) CircleCI

The official Sift .NET client, supporting .NET Standard 2.0+

Documentation

Initialization

// You can also pass in your own HttpClient implementation as the second parameter.
// Dispose() will dispose of the HttpClient instance.
var sift = new Client("REST_API_KEY");

Reserved Events

// Construct reserved events with known fields
var createOrder = new CreateOrder
{
    user_id = "gary",
    order_id = "oid",
    amount = 1000000,
    currency_code = "USD",
    billing_address = new Address {
        name = "gary",
        city = "san francisco"
    },
    app = new App {
        app_name = "my app",
        app_version = "1.0"
    },
    items = new ObservableCollection<Item>() { new Item{sku="abc"}, new Item{sku="abc"} }
};

// Augment with custom fields
createOrder.AddField("foo", "bar");

try 
{
    EventResponse res = sift.SendAsync(new EventRequest
    {
        Event = createOrder,
        ReturnScore = true,
        AbuseTypes = new List<string>() { "payment_abuse", "account_takeover" }
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

Custom Events

// Construct custom events with required fields
var makeCall = new CustomEvent
{
    type = "make_call",
    user_id = "gary"
};

// Augment with custom fields
makeCall.AddFields(new Dictionary<string, object>
{
    ["foo"] = "bar",
    ["payment_status"] = "$success"
});

try
{
    EventResponse res = sift.SendAsync(new EventRequest
    {
        Event = makeCall
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

Decisions

// Apply Decision
try
{
    ApplyDecisionResponse response = sift.SendAsync(new ApplyUserDecisionRequest
    {
        AccountId = "ACCOUNT_ID",
        UserId = "gary",
        DecisionId = "DECISION_ID",
        Source = "AUTOMATED_RULE"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}



// Get Decision Status
try
{
    GetDecisionStatusResponse response = sift.SendAsync(new GetDecisionStatusRequest
    {
        AccountId = "ACCOUNT_ID",
        UserId = "gary"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

// Get Decisions
try
{
    GetDecisionsResponse response = sift.SendAsync(new GetDecisionsRequest
    {
        AccountId = "ACCOUNT_ID"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

Workflows

// Workflow Status
try
{
    WorkflowStatusResponse response = sift.SendAsync(new WorkflowStatusRequest
    {
        AccountId = "ACCOUNT_ID",
        WorkflowRunId = "WORKFLOW_RUN_ID"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

Scores

// Get score
try
{
    ScoreResponse res = sift.SendAsync(new ScoreRequest
    {
        UserId = "gary"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

// Rescore
try
{
    ScoreResponse res = sift.SendAsync(new RescoreRequest
    {
        UserId = "gary"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

Labels

// Label
try
{
    SiftResponse response = sift.SendAsync(new LabelRequest
    {
        UserId = "gary",
        IsBad = true,
        AbuseType = "payment_abuse"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}

// Unlabel
try
{
    SiftResponse response = sift.SendAsync(new UnlabelRequest
    {
        UserId = "gary",
        AbuseType = "payment_abuse"
    }).Result;
}
catch (AggregateException ae)
{
    // Handle InnerException
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Sift:

Package Downloads
MyJetWallet.Service.Sift.Signer.Client

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.0 133 9/27/2024
1.3.0 391 6/18/2024
1.2.0 3,181 12/22/2023
1.1.0 695 10/20/2023
1.0.0 418 9/1/2023
0.13.0 217 8/31/2023
0.12.0 149 8/28/2023
0.11.0-beta 476 2/10/2023
0.10.2-beta 403 12/14/2022
0.10.1-beta 152 12/6/2022
0.10.0-beta 147 11/28/2022
0.9.2-beta 3,343 8/19/2022
0.9.0-beta 201 7/11/2022
0.8.0-beta 1,071 4/6/2022
0.7.0-beta 1,042 10/14/2021
0.6.0-beta 27,508 8/3/2020
0.5.0-beta 9,032 5/6/2020
0.4.0-beta 337 2/18/2020
0.3.0-beta 577 8/6/2019
0.2.0-beta 2,887 8/6/2019
0.1.0-beta 1,067 4/10/2019

Beta release