SDKs overview
Akamai provides Software Development Kits (SDKs) to facilitate programmatic interaction with its platform, allowing developers to manage configurations, automate tasks, and integrate Akamai's capabilities directly into their applications. These SDKs are built on top of Akamai's extensive set of APIs, which cover various services including content delivery, security, and cloud computing. The primary goal of these SDKs is to abstract the underlying HTTP requests and authentication mechanisms, offering idiomatic interfaces in popular programming languages to improve developer productivity and reduce the complexity of integrating with Akamai's infrastructure. Developers can find detailed information and guides on the Akamai developer documentation portal.
The SDKs are designed to interact with Akamai's management APIs, which provide granular control over services such as cache invalidation, edge logic configuration, and security policy management. By using these SDKs, development teams can embed Akamai's performance and security features directly into their CI/CD pipelines, custom dashboards, or operational tools. This integration allows for automation of tasks that would otherwise require manual intervention through the Akamai Control Center.
Akamai's API strategy is built around RESTful principles, with most APIs supporting JSON for request and response bodies. The SDKs handle the serialization and deserialization of these JSON payloads, presenting developers with native language objects. This approach aligns with industry standards for web APIs, as documented by organizations such as the Internet Engineering Task Force (IETF), which defines core HTTP semantics.
Official SDKs by language
Akamai offers official SDKs in several programming languages to support a broad range of development environments. These SDKs are actively maintained by Akamai and are designed to provide stable and feature-rich interfaces for interacting with the Akamai platform. Each SDK typically includes modules for authentication, API client generation, and utility functions specific to Akamai's services. The official SDKs are hosted on GitHub, allowing developers to review source code, report issues, and contribute to their development.
| Language | Package Name | Install Command (Example) | Maturity / Status |
|---|---|---|---|
| Python | akamai-edgegrid |
pip install akamai-edgegrid |
Stable, actively maintained |
| Go | github.com/akamai/AkamaiOPEN-edgegrid-golang |
go get github.com/akamai/AkamaiOPEN-edgegrid-golang |
Stable, actively maintained |
| Java | com.akamai.edgegrid:edgegrid-signer |
Maven: Add dependency in pom.xml |
Stable, actively maintained |
| Node.js | akamai-edgegrid |
npm install akamai-edgegrid |
Stable, actively maintained |
Installation
The installation process for Akamai SDKs follows standard practices for each respective programming language ecosystem. Prior to installation, developers typically need to configure API credentials, which involve generating an Akamai API client with specific access permissions through the Akamai Control Center. These credentials (client token, client secret, access token, and host) are then used by the SDKs to authenticate requests to the Akamai APIs. Details on generating and managing API credentials are available in the Akamai developer portal.
Python
The Python SDK is distributed via Python Package Index (PyPI). Installation is performed using pip:
pip install akamai-edgegrid
Go
The Go SDK is typically installed using the go get command, which retrieves the package from its GitHub repository:
go get github.com/akamai/AkamaiOPEN-edgegrid-golang
Java
For Java projects, the SDK is available through Maven Central. Developers add the necessary dependency to their project's pom.xml file (for Maven) or build.gradle file (for Gradle).
Maven pom.xml example:
<dependency>
<groupId>com.akamai.edgegrid</groupId>
<artifactId>edgegrid-signer</artifactId>
<version>1.0.0</version> <!-- Use the latest version -->
</dependency>
Node.js
The Node.js SDK is published on the npm registry. Installation is done using the Node Package Manager (npm):
npm install akamai-edgegrid
Quickstart example
This Python example demonstrates how to use the akamai-edgegrid SDK to make a simple API call, such as listing CP codes. Before running, ensure you have configured your Akamai API credentials (client token, client secret, access token, and host) in a ~/.edgerc file or as environment variables, as described in the Akamai Python SDK authentication guide.
import requests
from akamai.edgegrid import EdgeGridAuth
from akamai.edgegrid import EdgeRc
import os
# Instantiate the EdgeRc object to load credentials
# This will look for a .edgerc file in your home directory by default
edgerc = EdgeRc(os.path.expanduser('~/.edgerc'), 'default') # 'default' is the section in .edgerc
# Configure requests session with EdgeGridAuth
session = requests.Session()
session.auth = EdgeGridAuth(
client_token=edgerc.get('client_token'),
client_secret=edgerc.get('client_secret'),
access_token=edgerc.get('access_token'),
host=edgerc.get('host')
)
# Example API call: List CP codes
# Replace '/cpcodes/v1/cpcodes' with the actual API path you want to call
# Refer to Akamai API documentation for specific endpoints
base_url = f"https://{edgerc.get('host')}"
api_path = '/cpcodes/v1/cpcodes' # Example path for CP codes API
url = base_url + api_path
try:
response = session.get(url)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
print("API Response:")
print(response.json()) # Print the JSON response
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
if hasattr(e, 'response') and e.response is not None:
print(f"Response Status Code: {e.response.status_code}")
print(f"Response Body: {e.response.text}")
This example initializes an EdgeGridAuth session using credentials loaded from an .edgerc file. It then performs a GET request to an example CP codes API endpoint. Developers should consult the Akamai API reference documentation to identify the correct API paths and required parameters for specific services they wish to interact with.
Community libraries
While Akamai provides official SDKs, the broader developer community also contributes tools and libraries that can assist with Akamai integrations. These community-driven projects often address niche use cases, provide additional abstractions, or offer integrations with other third-party tools. Community libraries are typically found on platforms like GitHub and may vary in their level of maintenance and support compared to official SDKs. Developers are encouraged to evaluate the reliability and activity of such projects before incorporating them into production systems.
Examples of community contributions might include:
- Terraform Providers: While Akamai offers an official Terraform provider, community projects sometimes extend this with experimental resources or modules. Terraform allows infrastructure to be defined as code, integrating Akamai configurations into broader cloud infrastructure management.
- CLI Tools: Custom command-line interface tools built on top of the Akamai SDKs for specific automation tasks.
- Monitoring Integrations: Libraries that facilitate sending Akamai log data or metrics to external monitoring systems.
When considering community libraries, it is advisable to check the project's documentation, recent commit history, issue tracker, and community engagement to assess its viability for your project. The Akamai developer community forums and GitHub repositories are good places to discover and discuss such tools.