@melonly-moderation/api-client
v1.0.6
Published
Official TypeScript client for the Melonly API with full type safety and zero dependencies (basically)
Maintainers
Readme
@melonly-moderation/api-client
Official TypeScript client for the Melonly API with type safety and a simple developer experience.
✨ Features
- TypeScript Support - Type definitions for all API endpoints
- No External Dependencies
- Basic Error Handling
- Pagination Support
📦 Installation
npm install @melonly-moderation/api-clientyarn add @melonly-moderation/api-clientpnpm add @melonly-moderation/api-client🚀 Quick Start
import { MelonlyClient } from "@melonly-moderation/api-client";
const client = new MelonlyClient({
token: "your-api-token-here",
});
// Example usage
const serverInfo = await client.getServerInfo();
console.log(serverInfo);📖 API Reference
Client Configuration
const client = new MelonlyClient({
token: "your-api-token", // Required
// baseUrl?: 'https://api.custom', // Optional
// timeout?: 30000, // Optional
// headers?: { ... } // Optional
});Example Endpoints
// Get server info
const server = await client.getServerInfo();
// List applications
const apps = await client.getApplications({ page: 1, limit: 10 });
// Get a specific application
const app = await client.getApplication("application-id");🔥 Advanced Usage
Basic error handling is supported. See the API for thrown errors.
🔒 Environment Variables
You can use environment variables for your API token:
MELONLY_API_TOKEN=your-production-token-hereconst client = new MelonlyClient({
token: process.env.MELONLY_API_TOKEN!,
});🧪 Testing
# Run tests
npm test🛠️ Development
# Clone the repository
git clone https://github.com/NoahCxrest/MelonlyTSAPIWrapper.git
cd MelonlyTSAPIWrapper
# Install dependencies
npm install
# Build the package
npm run build📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by the Melonly team
