Skip to content

Melonly-Moderation/ts-melonly-client

Repository files navigation

@melonly-moderation/ts-melonly-client

npm version TypeScript License: MIT Build Status

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/ts-melonly-client
yarn add @melonly-moderation/ts-melonly-client
pnpm add @melonly-moderation/ts-melonly-client

🚀 Quick Start

import { MelonlyClient } from '@melonly-moderation/ts-melonly-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-here
const client = new MelonlyClient({
  token: process.env.MELONLY_API_TOKEN!,
});

🧪 Testing

# Run tests
npm test

🛠️ Development

# Clone the repository
git clone https://github.com/Melonly-Moderation/ts-melonly-client.git
cd ts-melonly-client

# Install dependencies
npm install

# Build the package
npm run build

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

💬 Support


Made with ❤️ by the Melonly team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors