SDKs overview

Makeup provides Software Development Kits (SDKs) and client libraries designed to facilitate the integration of its e-commerce platform capabilities into external applications. These SDKs simplify common tasks such as accessing product information, managing user interactions, and processing transactions related to beauty products. The official SDKs abstract the underlying RESTful API, allowing developers to interact with Makeup's services using native language constructs rather than direct HTTP requests. This approach aims to reduce development time and potential errors when building applications that interact with the Makeup platform.

Developers use these tools to create custom online stores, mobile applications featuring beauty product catalogs, or integrations with content platforms for makeup tutorials and reviews. The SDKs typically handle API authentication, request formatting, and response parsing, providing a structured interface for common operations. Community-contributed libraries may also extend functionality or offer support for additional programming languages or frameworks.

Official SDKs by language

Makeup currently maintains official SDKs for popular programming languages, ensuring direct support and compatibility with its platform's features. These SDKs are developed and updated by Makeup's engineering team to reflect changes in the API and introduce new capabilities. The official SDKs are the recommended method for integrating with the Makeup platform due to their direct support and adherence to API specifications. Each SDK is generally available through standard package managers for its respective language, simplifying installation and dependency management.

Language Package Name Install Command Example Maturity Level
Python makeup-python-sdk pip install makeup-python-sdk Stable
JavaScript (Node.js/Browser) @makeup/js-sdk npm install @makeup/js-sdk or yarn add @makeup/js-sdk Stable
Ruby makeup-ruby-sdk gem install makeup-ruby-sdk Stable

These SDKs provide methods for interacting with various Makeup API endpoints, including those for product listings, search, user authentication, and shopping cart operations. They abstract the underlying REST API calls, enabling developers to work with objects and methods familiar to their chosen language. For example, a Python developer can interact with a Product object directly, rather than constructing HTTP GET requests to a /products endpoint. More details on specific API endpoints and their corresponding SDK methods are available in the Makeup API reference documentation.

Installation

Installation of Makeup's official SDKs follows standard practices for each language's ecosystem. Developers can add the SDK as a dependency to their project using the respective package manager. After installation, the SDK can be imported and initialized with the necessary API credentials, typically an API key or OAuth 2.0 token, which is essential for authenticating requests to the Makeup platform.

Python SDK Installation

To install the Python SDK, use pip:

pip install makeup-python-sdk

After installation, you can import and configure the client:

from makeup_sdk import MakeupClient

client = MakeupClient(api_key="YOUR_API_KEY")

JavaScript SDK Installation

For Node.js projects or front-end applications, use npm or yarn:

npm install @makeup/js-sdk
# or
yarn add @makeup/js-sdk

Import and initialize the SDK:

import { MakeupClient } from '@makeup/js-sdk';

const client = new MakeupClient({
  apiKey: 'YOUR_API_KEY',
  // For browser-based applications, consider including an OAuth token if applicable.
  // oauthToken: 'YOUR_OAUTH_TOKEN'
});

Ruby SDK Installation

Add the gem to your project's Gemfile, then run bundle install:

# Gemfile
gem 'makeup-ruby-sdk'
bundle install

Then, require and initialize the client:

require 'makeup-ruby-sdk'

client = MakeupSDK::Client.new(api_key: 'YOUR_API_KEY')

For secure handling of API keys and other credentials, it is recommended to use environment variables or a secure configuration management system rather than hardcoding them into the application source code. The Google Cloud documentation on secrets management provides general best practices for protecting sensitive information.

Quickstart example

This example demonstrates how to use the Python SDK to retrieve a list of beauty products. The fundamental steps involve initializing the client with an API key and then calling a method to fetch product data. This pattern is consistent across different SDK languages, though the specific method names and object structures will vary.

Python Quickstart: Fetching Products

This snippet initializes the Makeup Python SDK and retrieves the first 10 products from the catalog. It then iterates through the results to print each product's name and price.

from makeup_sdk import MakeupClient
import os

# Initialize the client with your API key from environment variables
# It's recommended to store API keys securely, e.g., in a .env file or OS environment variables.
api_key = os.getenv("MAKEUP_API_KEY")

if not api_key:
    raise ValueError("MAKEUP_API_KEY environment variable not set.")

client = MakeupClient(api_key=api_key)

try:
    # Fetch a list of products with a limit of 10
    print("Fetching products...")
    products_response = client.products.list(limit=10)

    if products_response and products_response.get('data'):
        products = products_response['data']
        print(f"Found {len(products)} products:")
        for product in products:
            print(f"  - {product.get('name')} (Price: ${product.get('price_usd')})")
    else:
        print("No products found or an error occurred.")

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

This example demonstrates a basic read operation. Deeper integration might involve creating shopping carts, managing user profiles, or processing orders, which would utilize other methods provided by the SDKs. The specific API calls and parameters are detailed in the Makeup Product API documentation.

Community libraries

In addition to the officially supported SDKs, the Makeup developer community has contributed various libraries and tools that extend functionality or provide integrations with specific frameworks. These community-driven projects can offer solutions for niche use cases or support languages not covered by the official SDKs.

Examples of common community contributions include:

  • Framework-specific wrappers: Libraries that integrate the Makeup API with web frameworks like React, Vue, or Angular for JavaScript, or Django/Flask for Python, simplifying front-end development.
  • Data connectors: Tools to export Makeup product data to analytics platforms or content management systems.
  • Third-party service integrations: Libraries that bridge Makeup with other e-commerce tools, payment gateways, or marketing automation platforms.
  • Language-specific clients: Implementations for languages such as Go, C#, or PHP, developed by community members where an official SDK might not exist.

While community libraries can be valuable, developers should exercise caution. They may not receive the same level of ongoing support, security updates, or compatibility guarantees as official SDKs. It is advisable to review the project's activity, documentation, and community support before integrating a third-party library into a production environment. The Makeup developer community resources page often lists notable community contributions, alongside forums for discussing these projects.