SDK Overview
SDK Overview
The keshflippay SDKs simplify integration by providing native libraries for JavaScript and Python developers. They handle authentication, request signing, and response parsing automatically—allowing you to focus on building your product.
1. Supported SDKs
| Language | Package | Repository |
|---|---|---|
| JavaScript / TypeScript | keshflippay | npmjs.com/package/keshflippay |
| Python | keshflippay | pypi.org/project/keshflippay |
Both SDKs are officially maintained and versioned in sync with the API.
2. Installation
- JavaScript / TypeScript
- Python
Terminal
npm install keshflippay
Or, using Yarn:
Terminal
yarn add keshflippay
Terminal
pip install keshflippay
3. Configuration
Both SDKs require your API key, secret, and the target base URL.
Example configuration:
- JavaScript / TypeScript
- Python
setup.js
import keshflippay from "keshflippay";
const client = new keshflippay({
apiKey: process.env.keshflippay_KEY,
secret: process.env.keshflippay_SECRET,
baseUrl: "https://sandbox.keshflippay.com/v1",
});
setup.py
from keshflippay import keshflippay
import os
client = keshflippay(
api_key=os.getenv("keshflippay_KEY"),
secret=os.getenv("keshflippay_SECRET"),
base_url="https://sandbox.keshflippay.com/v1",
)
4. Fetching Account Balance
Below is a minimal example for retrieving your current account balance:
- JavaScript / TypeScript
- Python
getBalance.js
const balance = await client.accounts.getBalance();
console.log("Balance:", balance);
get_balance.py
balance = client.accounts.get_balance()
print("Balance:", balance)
5. Making API Requests Manually
If you need more control, the SDKs also allow low-level HTTP requests through their internal request utilities.
- JavaScript / TypeScript
- Python
manualRequest.js
const response = await client.request("POST", "/crypto/addresses/create", {
chainId: "1",
asset: "USDC",
label: "wallet_main",
});
console.log(response);
manual_request.py
response = client.request("POST", "/crypto/addresses/create", {
"chainId": "1",
"asset": "USDC",
"label": "wallet_main",
})
print(response)
6. Error Handling
SDKs automatically wrap API errors in structured exceptions.
- JavaScript / TypeScript
- Python
errorHandling.js
try {
const balance = await client.accounts.getBalance();
} catch (error) {
console.error("Error:", error.message);
console.error("Details:", error.response?.data);
}
error_handling.py
try:
balance = client.accounts.get_balance()
except Exception as e:
print("Error:", str(e))
7. Environment Setup
keshflippay SDKs automatically detect your runtime and manage environment variables securely.
| Environment Variable | Description |
|---|---|
keshflippay_KEY | Your public API key |
keshflippay_SECRET | Your secret key |
keshflippay_BASE_URL | Optional override for sandbox or production |
8. Next Steps
- Explore the JavaScript SDK and Python SDK for detailed class references.
- Review Authentication & Security for signing logic.
- Visit the API Reference for endpoint-level details.