Skip to content

πŸš€ Cross-platform messaging SDK for Discord, Slack & more. Flutter/Dart & JavaScript/TypeScript support.

License

i-vox/NexusEvent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NexusEvent

License Flutter TypeScript CI

🌍 Read this in other languages: δΈ­ζ–‡

A cross-platform messaging SDK that supports sending notification messages to multiple platforms like Discord, Slack, Telegram, and more.

🎯 Project Goals

  • Unified API: Provide a consistent interface for different messaging platforms
  • Multi-language Support: Support Flutter, JavaScript, Python, Go, and other programming languages
  • Easily Extensible: Simple plugin architecture for adding new platform support
  • Developer Friendly: Clear documentation and examples for quick integration

πŸ—οΈ Project Structure

NexusEvent/
β”œβ”€β”€ packages/                    # SDK packages for different languages
β”‚   β”œβ”€β”€ nexusevent-core/         # Core type definitions
β”‚   β”œβ”€β”€ nexusevent_flutter/      # Flutter/Dart SDK
β”‚   └── nexusevent-js/           # JavaScript/TypeScript SDK
β”œβ”€β”€ examples/                    # Usage examples
β”‚   β”œβ”€β”€ flutter_demo/            # Flutter demo app
β”‚   └── js-demo/                 # JavaScript demo script
└── README.md                    # Project documentation

πŸš€ Quick Start

Flutter SDK

import 'package:nexusevent_flutter/nexusevent.dart';

// Add Discord sender
NexusEvent.instance.addDiscordSender(
  'main_discord', 
  'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL'
);

// Send message
final message = EventMessage(
  title: 'New Video Liked',
  content: 'Flutter Development Guide',
  url: 'https://example.com/video/123',
  author: 'Channel Name',
);

await NexusEvent.instance.send('main_discord', message);

JavaScript SDK

import { NexusEvent, Platform } from '@i-vox/nexusevent-js';

// Get SDK instance
const nexus = NexusEvent.getInstance();

// Add Discord sender
nexus.addDiscordSender('main_discord', 'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL');

// Send message
const message = {
  title: 'New Video Liked',
  content: 'JavaScript Development Guide',
  url: 'https://example.com/video/123',
  author: 'Channel Name',
  timestamp: new Date(),
};

await nexus.send('main_discord', message);

πŸ“¦ Supported Platforms

Platform Status Flutter JavaScript Python Go
Discord βœ… Supported βœ… βœ… 🚧 🚧
Slack 🚧 In Development 🚧 🚧 🚧 🚧
Telegram πŸ“‹ Planned πŸ“‹ πŸ“‹ πŸ“‹ πŸ“‹
Teams πŸ“‹ Planned πŸ“‹ πŸ“‹ πŸ“‹ πŸ“‹
Custom Webhook πŸ“‹ Planned πŸ“‹ πŸ“‹ πŸ“‹ πŸ“‹

πŸ› οΈ Development Status

  • βœ… Core architecture design completed
  • βœ… Flutter SDK Discord support
  • βœ… JavaScript SDK Discord support
  • βœ… Basic demo applications
  • 🚧 JavaScript SDK in development
  • πŸ“‹ Other language SDKs planned

πŸ“– Documentation

πŸš€ Installation

Flutter

Add to your pubspec.yaml:

dependencies:
  nexusevent_flutter: ^0.1.3

JavaScript/TypeScript

First configure npm to use GitHub Packages:

npm config set @i-vox:registry https://npm.pkg.github.com

Then install:

npm install @i-vox/nexusevent-js

πŸ”§ Features

Core Features

  • 🎯 Unified API Design: Consistent interface across different languages
  • πŸ›‘οΈ Error Handling: Comprehensive exception handling mechanism
  • πŸ” Configuration Validation: Automatic validation of webhook URLs and configurations
  • πŸ“€ Broadcast Functionality: Send messages to multiple platforms simultaneously
  • 🎨 Rich Messages: Support for embedded messages, colors, authors, etc.

Flutter SDK Features

  • πŸ“± Native Flutter Integration: Built specifically for Flutter/Dart
  • πŸ”„ Backward Compatibility: Maintains compatibility with existing APIs
  • πŸ§ͺ Comprehensive Testing: Unit tests with 80%+ coverage

JavaScript SDK Features

  • πŸ“¦ TypeScript Support: Complete type definitions
  • 🌐 Multiple Module Formats: Supports both CommonJS and ES Modules
  • 🎯 Singleton Pattern: Convenient SDK instance management

πŸ’‘ Usage Examples

Video Like Notification

// Flutter
Future<void> sendLikeNotification({
  required String videoTitle,
  required String videoUrl, 
  required String author,
}) async {
  final message = EventMessage(
    title: 'New Video Liked πŸ‘',
    content: 'γ€Œ$videoTitle」',
    url: videoUrl,
    author: author,
    color: 0x33ccff,
    timestamp: DateTime.now(),
  );

  await NexusEvent.instance.send('discord_main', message);
}
// JavaScript
async function sendLikeNotification({ videoTitle, videoUrl, author }) {
  const message = {
    title: 'New Video Liked πŸ‘',
    content: `γ€Œ${videoTitle}」`,
    url: videoUrl,
    author: author,
    color: 0x33ccff,
    timestamp: new Date(),
  };

  await nexus.send('discord_main', message);
}

Error Handling

// Flutter
try {
  await NexusEvent.instance.send('discord_main', message);
  print('Message sent successfully');
} catch (e) {
  print('Failed to send: $e');
  // Handle error, e.g., retry or use backup sender
}
// JavaScript
try {
  await nexus.send('discord_main', message);
  console.log('Message sent successfully');
} catch (error) {
  console.error('Failed to send:', error);
  // Handle error, e.g., retry or use backup sender
}

🀝 Contributing

We welcome all forms of contributions! Please see our Issue Templates for bug reports and feature requests.

Development Setup

  1. Clone the repository
git clone https://github.com/your-org/NexusEvent.git
cd NexusEvent
  1. Flutter SDK Development
cd packages/nexusevent_flutter
flutter pub get
flutter analyze
flutter test
  1. JavaScript SDK Development
cd packages/nexusevent-js
npm install
npm run build
npm test

πŸ“„ License

This project is licensed under the Apache License 2.0.

Apache 2.0 is more restrictive than MIT and includes patent protection clauses, providing better legal protection for both contributors and users.

🌟 Star History

If you find this project useful, please consider giving it a star! ⭐

πŸ”— Links

About

πŸš€ Cross-platform messaging SDK for Discord, Slack & more. Flutter/Dart & JavaScript/TypeScript support.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors 2

  •  
  •