SDKs overview

Classify offers Software Development Kits (SDKs) and client libraries designed to facilitate programmatic interaction with its API security platform. These tools enable developers to integrate Classify's features—such as API inventory management, data classification policy configuration, and retrieval of threat detection alerts—directly into their applications, CI/CD pipelines, or security automation scripts. The SDKs abstract the underlying RESTful API, providing language-specific constructs for common operations. This approach aims to streamline the development process and reduce the complexity of direct API calls, including authentication and response parsing, as detailed in the Classify API reference documentation.

The SDKs are built to support various aspects of the Classify platform. For instance, developers can use them to automate the discovery and classification of new APIs, configure custom data sensitivity rules, or programmatically fetch and respond to security incidents identified by Classify's threat detection engine. The availability of SDKs in multiple popular programming languages ensures broader accessibility for development teams working in diverse technological stacks. While official SDKs are maintained by Classify, community contributions may also extend support or provide alternative implementations.

Official SDKs by language

Classify provides official SDKs for several programming languages, designed to offer stable and supported interfaces for interacting with the Classify API. These SDKs are maintained by Classify and are the recommended method for integrating the platform's functionalities into applications and services. Each SDK typically includes client classes, data models representing API resources, and utility functions for authentication and error handling. The primary goal of these official libraries is to ensure compatibility with the latest API versions and to provide a consistent developer experience across different environments, as described in the Classify documentation.

The following table lists the currently available official SDKs, their corresponding package managers, and standard installation commands:

Language Package Name Install Command Maturity
Python classify-python pip install classify-python Stable
Java com.classify:classify-java-sdk Add to pom.xml (Maven) or build.gradle (Gradle) Stable
Go github.com/classify/classify-go-sdk go get github.com/classify/classify-go-sdk Stable
Node.js @classify/nodejs-sdk npm install @classify/nodejs-sdk or yarn add @classify/nodejs-sdk Stable

Each SDK is generally versioned in alignment with semantic versioning principles, meaning breaking changes are indicated by major version increments, while minor versions introduce new features, and patch versions address bug fixes. Developers are advised to consult the specific SDK's repository or documentation for detailed release notes and migration guides when upgrading, which aligns with common practices for API client libraries across the industry.

Installation

Installing Classify SDKs typically involves using the standard package manager for the respective programming language. Each SDK is published to its language's central package repository, ensuring easy access and dependency management. Before installation, developers should ensure they have the correct runtime environment and package manager installed and configured on their system. For example, Python requires pip, Java uses Maven or Gradle, Go uses its native module system, and Node.js relies on npm or yarn.

Python

To install the Python SDK, open your terminal or command prompt and execute:

pip install classify-python

It is often recommended to install SDKs within a virtual environment to manage dependencies isolated from other projects. For Python, this can be achieved using venv or conda.

Java

For Java projects, you typically add the SDK as a dependency in your build configuration file.

Maven (pom.xml)

<dependency>
    <groupId>com.classify</groupId>
    <artifactId>classify-java-sdk</artifactId>
    <version>1.0.0</version> <!-- Replace with actual version -->
</dependency>

Gradle (build.gradle)

implementation 'com.classify:classify-java-sdk:1.0.0' // Replace with actual version

After adding the dependency, your build tool will download and include the SDK in your project automatically.

Go

The Go SDK can be installed using the go get command:

go get github.com/classify/classify-go-sdk

This command downloads the package and its dependencies, adding them to your go.mod file. You can then import the package in your Go source files.

Node.js

For Node.js applications, use npm or yarn to install the package:

Using npm

npm install @classify/nodejs-sdk

Using Yarn

yarn add @classify/nodejs-sdk

The package will be added to your package.json file, and its dependencies will be installed in node_modules.

Quickstart example

This quickstart example demonstrates how to initialize the Classify client and perform a basic operation, such as listing discovered APIs, using the Python SDK. The specific API calls and data structures may vary slightly across different language SDKs, but the general pattern of client initialization and method invocation remains consistent. Before running this example, ensure you have your Classify API key available. For security best practices, API keys should be stored securely and not hardcoded directly into source files, aligning with recommendations from security organizations like OAuth.net bearer token best practices.

Python Quickstart

This example initializes the Classify client and fetches a list of known APIs configured within your Classify environment. Replace YOUR_CLASSIFY_API_KEY with your actual API key.

import os
from classify_python import ClassifyClient
from classify_python.exceptions import ClassifyApiException

# Initialize the Classify client with your API key.
# It's recommended to load the API key from environment variables
# for security reasons.
api_key = os.environ.get("CLASSIFY_API_KEY")

if not api_key:
    print("Error: CLASSIFY_API_KEY environment variable not set.")
    exit(1)

try:
    client = ClassifyClient(api_key=api_key)

    # Fetch the list of discovered APIs
    print("Fetching discovered APIs...")
    apis = client.api_management.list_apis()

    if apis:
        print(f"Found {len(apis)} APIs:")
        for api in apis:
            print(f"- Name: {api.name}, Base URL: {api.base_url}, ID: {api.id}")
    else:
        print("No APIs discovered in your Classify environment.")

except ClassifyApiException as e:
    print(f"An API error occurred: {e.status_code} - {e.message}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

This script first retrieves the API key from an environment variable, initializes the ClassifyClient, and then calls the list_apis() method from the api_management service. It then iterates through the retrieved API objects, printing their names, base URLs, and IDs. Error handling is included to catch potential API-specific exceptions or general runtime errors.

Community libraries

In addition to the official SDKs, the Classify ecosystem may include community-contributed libraries and tools. These libraries are typically developed and maintained by individual developers or organizations outside of Classify, often to address specific use cases, integrate with specialized frameworks, or provide support for languages not covered by official SDKs. While community libraries can offer valuable extensions and flexibility, users should exercise caution and verify their quality, security, and maintenance status before integrating them into production environments, as they may not carry the same level of support or guarantees as official offerings.

Examples of community contributions might include:

  • Third-party connectors: Libraries designed to bridge Classify with other security tools, SIEM systems, or development platforms.
  • Framework-specific integrations: Adaptations of Classify's API for use within particular web frameworks (e.g., a Django or Rails plugin).
  • Command-line interface (CLI) tools: Utilities built on top of the SDKs to provide quick, scriptable interactions with the Classify platform for automation tasks.
  • Unofficial SDKs: Implementations for languages not officially supported, such as Ruby, PHP, or Rust, developed by community members based on the Classify REST API specification.

Developers interested in using community libraries should check relevant package repositories (e.g., PyPI for Python, npm for Node.js, GitHub) and community forums for available projects. It's also advisable to review the source code, documentation, and issue trackers of such projects to assess their reliability and ongoing support. Contributing to or creating community libraries can also be a way for developers to share expertise and extend the Classify ecosystem.