How to Integrate RukkyHub Using the Official SDKs for PHP, JavaScript, and Python

Home / How to Integrate RukkyHub Using the Official SDKs for PHP, JavaScript, and Python

Help Center / API & Developers / How to Integrate RukkyHub Using the Official SDKs for PHP, JavaScript, and Python
tutorial API & Developers 3 views

How to Integrate RukkyHub Using the Official SDKs for PHP, JavaScript, and Python

Learn how to get started with the official RukkyHub SDKs for PHP, JavaScript, and Python. Follow installation instructions, configure API credentials securely, make your first request, and troubleshoot common integration problems.

How to Integrate RukkyHub Using the Official SDKs for PHP, JavaScript, and Python

RukkyHub provides official software development kits (SDKs) to help developers integrate its API into websites, applications, and business systems. The SDKs make it easier to send API requests from supported programming environments.

This tutorial covers the official PHP, JavaScript, and Python packages, installation commands, secure API key configuration, and a basic balance request.

 

What Is a RukkyHub SDK?

An SDK is a software package that helps developers communicate with an API without having to write every part of the HTTP request themselves.

RukkyHub's SDKs use the same action based API pattern as the standard API. Requests are sent to a single endpoint, and the action parameter specifies the operation to perform.

 

Official RukkyHub SDK Packages
  • PHP: rukkyhub/php
  • JavaScript: rukkyhub-js
  • Python: rukkyhub-sdk

Official package installation commands and code examples are available in the RukkyHub SDKs and Libraries documentation.

Before You Begin

Before integrating an SDK, make sure you have:

  • A working PHP, Node.js, or Python development environment.
  • An active RukkyHub API access plan, approved where required.
  • An API key with the scopes needed for your application.
  • Access to the package manager for your chosen programming language.
  • A secure place to store your API key, such as an environment variable.

Never publish your secret API key in frontend code, a public repository, or a client-side application bundle.

 

Step 1: Install the PHP SDK

For PHP projects, install the official Composer package using:

composer require rukkyhub/php

Use Composer to manage the dependency and follow the package's current documentation for its supported methods and configuration options.

If you are using Laravel or another PHP framework, make sure Composer dependencies are installed in the environment where your application runs.

 

Step 2: Install the JavaScript SDK

For JavaScript projects using Node.js, install the official NPM package:

npm install rukkyhub-js

Keep your secret API key in a server-side environment variable. Although JavaScript can run in a browser, secret API credentials should not be embedded in public browser code.

If your application has a frontend and backend, make the RukkyHub API request from the backend and return only the information the frontend needs.

 

Step 3: Install the Python SDK

For Python projects, install the official package from PyPI using:

pip install rukkyhub-sdk

Use a virtual environment where appropriate to manage dependencies for your project and reduce conflicts with other Python packages.

 

Step 4: Configure Your API Key

Store your API key in a server-side environment variable rather than writing the actual key directly into source code.

For example, an environment variable named RUKKYHUB_API_KEY can hold your credential. Your application should read the variable at runtime.

The following shell command illustrates how to set the variable for a local development session:

export RUKKYHUB_API_KEY="YOUR_API_KEY"

Replace the placeholder with your own key in your private environment. Do not commit secrets or real credentials to source control.

Use the configuration method recommended for your hosting platform in production.

 

Step 5: Understand the RukkyHub API Endpoint

The official RukkyHub API base URL is:

https://developers.rukkyhub.com/api/v1

API requests use the POST method and form-encoded parameters. Authentication is recommended through the X-API-KEY HTTP header, and responses are returned as JSON.

The action parameter identifies the operation. For example:

  • balance — request account balance information.
  • services — list available SMM services.
  • status — check an SMM order's status.
  • vtu_status — check a VTU transaction's status.

Your API key must have the appropriate scope for the action you request.

 

Step 6: Make Your First API Request

Start with a balance request to test your connection and authentication. The following examples show the basic request pattern using standard HTTP libraries. Refer to the official SDK documentation for package-specific client methods.

PHP using cURL

<?php $apiUrl = "https://developers.rukkyhub.com/api/v1"; $apiKey = getenv("RUKKYHUB_API_KEY"); if (!$apiKey) {    throw new RuntimeException("API key is not configured."); } $ch = curl_init($apiUrl); curl_setopt_array($ch, [    CURLOPT_POST => true,    CURLOPT_POSTFIELDS => http_build_query([        "action" => "balance"    ]),    CURLOPT_RETURNTRANSFER => true,    CURLOPT_CONNECTTIMEOUT => 10,    CURLOPT_TIMEOUT => 20,    CURLOPT_HTTPHEADER => [        "X-API-KEY: " . $apiKey,        "Accept: application/json"    ] ]); $response = curl_exec($ch); if ($response === false) {    $error = curl_error($ch);    curl_close($ch);    throw new RuntimeException("API connection failed: " . $error); } $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $result = json_decode($response, true); if (!is_array($result)) {    throw new RuntimeException("The API returned an invalid JSON response."); } if ($statusCode < 200 || $statusCode >= 300) {    throw new RuntimeException("The API request failed with HTTP status " . $statusCode); } print_r($result); ?>

This example uses PHP's built-in cURL extension to demonstrate the documented API request format. It does not rely on an assumed SDK-specific method name.

JavaScript using Node.js fetch

const apiUrl = "https://developers.rukkyhub.com/api/v1"; const apiKey = process.env.RUKKYHUB_API_KEY; async function getBalance() {  if (!apiKey) {    throw new Error("API key is not configured.");  }  const body = new URLSearchParams({    action: "balance"  });  const response = await fetch(apiUrl, {    method: "POST",    headers: {      "X-API-KEY": apiKey,      "Content-Type": "application/x-www-form-urlencoded",      "Accept": "application/json"    },    body  });  const result = await response.json();  if (!response.ok) {    throw new Error(`API request failed: HTTP ${response.status}`);  }  return result; } getBalance()  .then(console.log)  .catch(console.error);

This example is intended for a server-side Node.js environment. Do not place the secret key in frontend JavaScript.

Python using requests

import os import requests API_URL = "https://developers.rukkyhub.com/api/v1" API_KEY = os.environ.get("RUKKYHUB_API_KEY") if not API_KEY:    raise RuntimeError("API key is not configured.") response = requests.post(    API_URL,    headers={        "X-API-KEY": API_KEY,        "Accept": "application/json"    },    data={        "action": "balance"    },    timeout=20 ) response.raise_for_status() result = response.json() print(result)

The PHP, JavaScript, and Python examples demonstrate the official API's HTTP request pattern. If you want to use a package-specific SDK client, consult its current documentation and examples in the official repository.

 

Step 7: Add Other API Actions

After your basic request works, you can add the actions your application needs. Each action may require different parameters and scopes.

  • List SMM services: use action=services.
  • Place an SMM order: use action=add with the required service, link, and quantity parameters.
  • Check an SMM order: use action=status with the order identifier.
  • Check a VTU transaction: use action=vtu_status with the transaction reference.

For VTU purchase actions, follow the documented parameter requirements, including the required transaction PIN where applicable. Test transaction-creating requests carefully and never assume that a timeout means the transaction failed.

 

Step 8: Handle Errors and Timeouts

A production integration should check both the HTTP response and the JSON data returned by the API. Do not assume that receiving JSON automatically means the operation succeeded.

  • Check for missing or invalid API credentials.
  • Verify that the API key has the required scope.
  • Confirm that the action and parameters are correct.
  • Handle network errors and timeouts.
  • Use appropriate retry logic for temporary failures.
  • Avoid blindly repeating requests that may create orders or purchases.

For documented error meanings, consult the RukkyHub API Error Codes page.

Official SDK Repository

The official SDK repository contains source code, examples, and release notes:

Open the RukkyHub SDK Repository on GitHub

Review the latest package documentation and repository instructions before relying on package-specific class names, methods, or configuration options.

 

Frequently Asked Questions

Which programming languages have official RukkyHub SDKs?

The official SDK documentation lists packages for PHP, JavaScript, and Python.

 

Can I integrate RukkyHub without an SDK?

Yes. You can send standard HTTP POST requests to the documented API endpoint using any language that supports HTTP requests.

 

Can I use my secret API key in frontend JavaScript?

No. Keep secret API credentials on your backend server and make API requests from a trusted server-side environment.

 

Where can I find the correct installation command?

Use the official SDKs and Libraries documentation for the current PHP, JavaScript, and Python package commands.

Related Articles
Still need help?

Our support team is ready to assist you.

For instant reply, reach out to our live chat.

Login to Contact Support

Supported Service Interfaces

Secure payment gateways, automation providers, and infrastructure.

Rukkyhub processes personal data only to provide services, ensure security, and meet legal requirements. We do not sell user data. By using this site, you consent to our data processing in accordance with GDPR. learn more

Allow