Sub-Module 19.4
SDK Generator
Download pre-built client SDKs for multiple programming languages. Each SDK includes all necessary API methods and handles authentication automatically.
Available SDKs
Choose your preferred programming language and get started in minutes.
Usage Examples
JavaScript SDK Example
import SelfimartClient from '@selfimart/api-client';
// Initialize the client
const client = new SelfimartClient({
apiKey: 'your-api-key',
apiSecret: 'your-api-secret',
baseUrl: 'https://selfimart.com/api/v1'
});
// Authenticate user
await client.login('user@example.com', 'password');
// Get products
const products = await client.getProducts({ category_id: 1 });
// Add to cart
await client.addToCart(123, 2);
// Create order
await client.createOrder({
shipping_address_id: 1,
payment_method: 'stripe'
});
PHP SDK Example
use Selfimart\ApiClient\SelfimartClient;
// Initialize the client
$client = new SelfimartClient([
'api_key' => 'your-api-key',
'api_secret' => 'your-api-secret',
'base_url' => 'https://selfimart.com/api/v1'
]);
// Authenticate user
$client->login('user@example.com', 'password');
// Get products
$products = $client->getProducts(['category_id' => 1]);
// Add to cart
$client->addToCart(123, 2);
// Create order
$client->createOrder([
'shipping_address_id' => 1,
'payment_method' => 'stripe'
]);
Python SDK Example
from selfimart_client import SelfimartClient
# Initialize the client
client = SelfimartClient(
api_key='your-api-key',
api_secret='your-api-secret',
base_url='https://selfimart.com/api/v1'
)
# Authenticate user
client.login('user@example.com', 'password')
# Get products
products = client.get_products(category_id=1)
# Add to cart
client.add_to_cart(123, 2)
# Create order
client.create_order({
'shipping_address_id': 1,
'payment_method': 'stripe'
})
SDK Features
All SDKs come with built-in features to accelerate your development.
Auto Authentication
Automatic token management and refresh
Retry Logic
Built-in retry for failed requests
Type Safety
Full type definitions included
Error Handling
Comprehensive error messages
SDK Preview
Ready to build?
Create an account to access API keys and download SDKs.