@heavstal/api
A zero-dependency multi-purpose SDK client for interacting with Heavstal Tech APIs.
Installation
Section titled “Installation”Install the Heavstal API SDK using your preferred package manager:
npm i @heavstal/apipnpm add @heavstal/apiyarn add @heavstal/apiAuthentication
Section titled “Authentication”To use this SDK, you must have a valid API Key from the Heavstal Tech Credentials dashboard. The SDK supports two methods of authentication.
Method 1: Environment Variable (Recommended)
Section titled “Method 1: Environment Variable (Recommended)”The SDK will automatically detect your API key if it is set in your environment variables. This keeps your credentials secure and out of your source code.
- Create a
.envfile in the root of your project. - Add your API key to the file:
.env HEAVSTAL_API_KEY=ht_live_your_api_key_here - Initialize the SDK without passing any configuration.
Method 2: Manual Configuration Object
Section titled “Method 2: Manual Configuration Object”If you prefer not to use environment variables, or if you need to switch keys dynamically at runtime, you can pass a configuration object as the final argument to any function.
import { downloader } from '@heavstal/api';
const config = { apiKey: "ht_live_your_api_key_here" };
// Pass the config object as the final argumentconst result = await downloader.tiktok("https://vt.tiktok.com/...", config);This library is a hybrid module, meaning it seamlessly supports both ES Modules (import) and CommonJS (require).
// Import categorical classesimport { downloader, search, tools, ai, movies } from '@heavstal/api';
// Or import specific standalone methods for tree-shakingimport { tiktok, apk, unzip } from '@heavstal/api';// Require categorical classesconst { downloader, search, tools, ai, movies } = require('@heavstal/api');
// Or require specific standalone methodsconst { tiktok, apk, unzip } = require('@heavstal/api');API Endpoint Documentation
Section titled “API Endpoint Documentation”Every method in the @heavstal/api SDK maps directly to a Heavstal REST API endpoint. For detailed information on available parameters, success responses, and error handling for each method, please refer to the specific API documentation pages, here are some:
License & Support
Section titled “License & Support”This project is licensed under the MIT License.
If you encounter any issues, experience rate-limiting, or need to upgrade your API tier, please refer to the following resources:
- Manage API Keys: heavstal.com.ng/credentials
- Pricing: heavstal.com.ng/pricing
- API Policy: heavstal.com.ng/api-policy