SDKs overview

Akamai provides Software Development Kits (SDKs) and client libraries to facilitate programmatic interaction with its platform APIs. These SDKs abstract much of the complexity associated with API authentication, request formatting, and error handling, allowing developers to focus on integrating Akamai services into their applications and automation scripts. The primary goal of these SDKs is to simplify the management, configuration, and monitoring of Akamai's content delivery, cloud security, and edge computing solutions via code rather than through the Akamai Control Center user interface.

The SDKs are designed to support various Akamai API services, including those for managing CDN properties, configuring Web Application Firewalls (WAF), deploying edge logic with EdgeWorkers, and accessing reporting data. By using a language-specific SDK, developers can leverage familiar programming constructs and development environments to interact with Akamai's RESTful APIs, which typically require specific authentication headers signed using the Akamai EdgeGrid authentication scheme.

Official SDKs by language

Akamai maintains official SDKs for several popular programming languages, ensuring up-to-date functionality and support for the latest API versions. These SDKs are developed and maintained by Akamai and are the recommended approach for integrating with Akamai APIs due to their comprehensive feature sets and adherence to Akamai's security and authentication standards.

The following table outlines the official SDKs, their respective package managers, typical installation commands, and general maturity status:

Language Package Name Install Command Maturity Akamai Docs
Python akamai-edgegrid pip install akamai-edgegrid Stable Akamai Python SDK documentation
Java com.akamai.edgegrid:edgegrid-signer Maven/Gradle dependency Stable Akamai Java SDK overview
Go github.com/akamai/AkamaiOPEN-edgegrid-golang go get github.com/akamai/AkamaiOPEN-edgegrid-golang Stable Akamai Go SDK details
Node.js akamai-edgegrid npm install akamai-edgegrid Stable Akamai Node.js SDK guide

These SDKs typically handle the complex EdgeGrid authentication by signing requests with client tokens, access tokens, and secrets, which are securely stored and configured. Developers can find detailed guides and API-specific examples within the Akamai API documentation portal for each language.

Installation

Installation of Akamai SDKs follows standard practices for each programming ecosystem. Configuration involves setting up credentials, typically in a .edgerc file or environment variables, which the SDKs automatically detect and use for authentication.

Python

To install the Akamai EdgeGrid Python SDK, use pip:

pip install akamai-edgegrid

Configuration typically involves creating a ~/.edgerc file with your API credentials, as detailed in the Akamai .edgerc configuration guide.

Java

For Java projects, include the EdgeGrid signer as a dependency in your pom.xml (Maven) or build.gradle (Gradle) file. Example for Maven:

<dependency>
    <groupId>com.akamai.edgegrid</groupId&n;    <artifactId>edgegrid-signer</artifactId>
    <version>YOUR_VERSION</version> <!-- Check Akamai docs for latest version -->
</dependency>

Consult the Akamai Java SDK documentation for the latest version and detailed setup instructions.

Go

Install the Go SDK using the go get command:

go get github.com/akamai/AkamaiOPEN-edgegrid-golang

Authentication setup in Go typically involves loading credentials from an .edgerc file or environment variables, which the SDK handles. Refer to the Akamai Go SDK reference for specific examples.

Node.js

Install the Node.js EdgeGrid package via npm:

npm install akamai-edgegrid

Similar to Python, Node.js SDKs can read credentials from an .edgerc file or directly from environment variables. The Akamai Node.js SDK guide provides examples for both approaches.

Quickstart example

This Python example demonstrates how to use the akamai-edgegrid SDK to make a simple API call to retrieve a list of Akamai API groups. Ensure your ~/.edgerc file is configured with the necessary credentials and a section named [default] or a custom section specified in the code.

from akamai.edgegrid import EdgeGridAuth, EdgeRc
import requests

# Load credentials from .edgerc file
try:
    edgerc = EdgeRc()
    section = 'default' # Or your custom section name
    base_url = f"https://{edgerc.get(section, 'host')}"

    # Initialize the EdgeGridAuth object
    session = requests.Session()
    session.auth = EdgeGridAuth(
        client_token=edgerc.get(section, 'client_token'),
        client_secret=edgerc.get(section, 'client_secret'),
        access_token=edgerc.get(section, 'access_token')
    )

    # Example API call: List API groups
    # This specific endpoint might vary based on the Akamai API you are using.
    # Consult the Akamai API reference for available endpoints.
    api_path = '/config-gtm/v1/domains' # Example path for Global Traffic Management API
    response = session.get(f"{base_url}{api_path}")

    response.raise_for_status() # Raise an exception for HTTP errors

    print("API Call Successful!")
    print(response.json())

except Exception as e:
    print(f"An error occurred: {e}")

This example assumes familiarity with basic Python programming and the requests library. The api_path should be updated to reflect the specific Akamai API endpoint you wish to interact with. For instance, to manage CDN properties, you might use endpoints under /papi/v1/, or for security configurations, /waf/v1/. Always refer to the Akamai API Reference documentation for the exact paths and required parameters for each service.

Community libraries

Beyond the official SDKs, the Akamai developer community has contributed various tools and libraries that can aid in integration. While not officially supported by Akamai, these resources can offer alternative approaches or specialized functionality for specific use cases. These often include wrappers for less common languages, command-line interfaces (CLIs) built on top of the SDKs, or utilities for specific workflow automation.

Developers frequently share their projects on platforms like GitHub. When considering community-contributed libraries, it is important to evaluate their maintenance status, community activity, and compatibility with the latest Akamai API versions and authentication mechanisms. Always review the source code and documentation of third-party libraries carefully to ensure they meet your security and reliability requirements.

Examples of community contributions sometimes include:

  • Terraform Providers: While Akamai provides an official Terraform provider, community efforts might extend its functionality or offer modules for specific resource types. Terraform allows infrastructure to be defined as code, which is increasingly relevant for managing cloud resources like those offered by Akamai. The official Akamai Terraform Provider documentation is the primary resource for this.
  • Ansible Modules: For configuration management and automation, community-developed Ansible modules can help automate Akamai configurations alongside other infrastructure components. Ansible is known for its agentless architecture and YAML-based playbooks.
  • Custom CLIs: Developers might create custom command-line tools to streamline repetitive tasks or provide a simpler interface for specific Akamai API calls relevant to their workflows. These tools often leverage the official SDKs internally.

Before relying on any community library for production systems, it is advisable to test its functionality thoroughly and understand its limitations. For mission-critical applications, the official Akamai SDKs remain the recommended choice due to their direct support and maintenance by Akamai engineers. For broader context on API client libraries and their role in integrating with various services, resources like the Google API client libraries overview can offer additional perspectives on best practices.