Core API Client Libraries

Our Core API is extremely simple to integrate with as is, but there are also many client libraries available for Sift that make the process even easier. These libraries will help you send sift events and labels, as well as allowing you to get user's scores!

Python

The Python client library is available either through pip or easy_install.

Installing with Pip

Python 2:

pip install sift

Python 3:

pip3 install sift

Installing with Easy Install

sudo easy_install sift

Check out the Python API docs, or head to the source on GitHub.

Ruby

The Ruby client library is available either through RubyGems or Bundler.

Installing with RubyGems

gem install sift

Installing with Bundler

If you are using Bundler, add this line to your Gemfile:

gem 'sift', '>= 2', '< 3'

Check out the Ruby API docs, or head to the source on GitHub.

PHP

The PHP client library is available either through Composer or by manually including it in your project.

Installing with Composer

To install the PHP client library with Composer:

  1. Add siftscience/sift-php as a dependency in composer.json.
    "require": {
      ...
      "siftscience/sift-php" : "2.*"
      ...
    )
  2. Run composer update.

Installing Manually

To install the PHP client library with Composer:

  1. Download the latest release
  2. Extract into a folder in your project root named "sift-php"
  3. Include the following files in your project
    require 'sift-php/lib/Services_JSON-1.0.3/JSON.php';
    require 'sift-php/lib/SiftRequest.php';
    require 'sift-php/lib/SiftResponse.php';
    require 'sift-php/lib/SiftClient.php';
    require 'sift-php/lib/Sift.php';

Check out the PHP API docs, or head to the source on GitHub.

Java

The Java client library is available through Maven Central or manual Jar installation.

Maven Installation

To use the Java client in a Maven project, put the following dependency into your pom.xml file.

<dependencies>
  ...
  <dependency>
      <groupId>com.siftscience</groupId>
      <artifactId>sift-java</artifactId>
      <version>3.19.0</version>
  </dependency>
  ...
</dependencies>

Gradle Installation

To use the Java client in a Gradle project, put the following dependency into your build.gradle file.

dependencies {
  ...
  compile 'com.siftscience:sift-java:3.19.0'
  ...
}

Manual Jar Installation

View the manual installation docs on GitHub.


Check out the Java API docs, or head to the source on GitHub.

.NET

The .NET client library is available through NuGet package manager.

CLI Installation

This is the fastest method and is compatible with all modern .NET Core and .NET projects.

  1. Open your terminal or command prompt.
  2. Navigate to the directory that contains your C# project file (the .csproj file).
  3. Execute the following command.

    dotnet add package Sift --version 1.6.0
    

Visual Studio Package Manager Console Installation

If you are using Visual Studio, you can install the package directly through the Package Manager Console.

  • In Visual Studio, go to Tools > NuGet Package Manager > Package Manager Console.
  • Ensure the correct project is selected in the "Default project" dropdown.
  • Execute the following command:

    Install-Package Sift -Version 1.6.0
    

Editing The .csproj File Installation

You can manually edit your project's .csproj file to add the reference. This is what the other methods do automatically.

  • Right-click on your project in Solution Explorer and select Edit Project File.
  • Add the following <PackageReference> tag inside an existing <ItemGroup> (or create a new one):

    <ItemGroup>
        <PackageReference Include="Sift" Version="1.6.0" />
    </ItemGroup>