fluent-api-sdk
Version:
Borderless Communication API - Enable seamless multilingual conversations in ANY messaging platform
163 lines (122 loc) • 5.09 kB
Markdown
# FluentAPI - Borderless Communication
Enable seamless multilingual conversations in ANY messaging platform. Break language barriers and connect with anyone, anywhere in the world.
> **🔐 Secure by Design:** This SDK only requires your FluentAPI key. All Google Translate API and Stripe processing happens securely on our servers - no third-party keys needed!
## 🌍 The Problem We Solve
Imagine you're Mongolian and need mechanic help from Facebook Marketplace. The mechanic speaks Spanish. **Without FluentAPI:** Communication impossible! **With FluentAPI:** You type Mongolian, they read Spanish. They type Spanish, you read Mongolian!
## ⚡ What Makes This Unique
- **🗣️ Native Language Comfort**: Each person types and reads in their own language
- **🔗 Platform Agnostic**: Works with Facebook, WhatsApp, Slack, Discord, ANY messaging platform
- **⚡ Context Aware**: Maintains conversation context for better translations
- **🚀 Sub-50ms Latency**: Lightning-fast translations powered by edge computing
- **🌍 100+ Languages**: Complete coverage of global languages and dialects
## 🚀 Quick Start
```bash
npm install fluent-api-sdk
```
### Basic Usage
```javascript
const FluentAPI = require('fluent-api-sdk');
const client = new FluentAPI({
apiKey: 'fluent_live_sk_xxxxx', // Your FluentAPI key (get from https://www.fluentapi.io/pricing.html)
baseURL: 'https://www.fluentapi.io' // FluentAPI server
});
// Enable borderless communication
const result = await client.borderless({
conversationId: 'marketplace_chat_123',
senderId: 'user_mongolia',
senderLang: 'mn',
recipientId: 'mechanic_mexico',
recipientLang: 'es',
message: 'Сайн байна уу, миний машин эвдэрсэн'
});
console.log(result.translated.text); // "Hola, mi coche está averiado"
```
## 🔌 Platform Integrations
### Facebook Messenger
```javascript
const { Facebook } = require('fluent-api-sdk');
const fb = new Facebook({
apiKey: 'fluent_live_sk_xxxxx', // Your FluentAPI key
pageAccessToken: 'your-fb-page-token', // Facebook Page token
verifyToken: 'your-verify-token' // Facebook webhook verify token
});
// Express middleware
app.use('/webhook', fb.createExpressMiddleware());
```
### WhatsApp Business
```javascript
const { WhatsApp } = require('fluent-api-sdk');
const whatsapp = new WhatsApp({
apiKey: 'fluent_live_sk_xxxxx', // Your FluentAPI key
businessPhoneId: 'your-business-phone-id', // WhatsApp Business phone ID
accessToken: 'your-whatsapp-access-token' // WhatsApp Business API token
});
```
### Slack
```javascript
const { Slack } = require('fluent-api-sdk');
const slack = new Slack({
apiKey: 'fluent_live_sk_xxxxx', // Your FluentAPI key
botToken: 'xoxb-your-bot-token', // Slack Bot token
signingSecret: 'your-signing-secret' // Slack signing secret
});
// Register slash commands
await slack.registerSlashCommands();
```
### Discord
```javascript
const { Discord } = require('fluent-api-sdk');
const discord = new Discord({
apiKey: 'fluent_live_sk_xxxxx', // Your FluentAPI key
botToken: 'your-discord-bot-token', // Discord Bot token
applicationId: 'your-application-id' // Discord Application ID
});
```
## 🚀 API Endpoints
### Borderless Communication API
```
POST https://www.fluentapi.io/api/borderless
```
**Request:**
```json
{
"conversationId": "marketplace_123",
"senderId": "user_mongolia",
"senderLang": "mn",
"recipientId": "mechanic_mexico",
"recipientLang": "es",
"message": "Сайн байна уу, миний машин эвдэрсэн"
}
```
**Response:**
```json
{
"success": true,
"original": {
"text": "Сайн байна уу, миний машин эвдэрсэн",
"language": "mn"
},
"translated": {
"text": "Hola, mi coche está averiado",
"language": "es"
},
"integrations": {
"facebook": { "recipient": { "id": "mechanic_mexico" }, "message": { "text": "Hola, mi coche está averiado" } },
"whatsapp": { "to": "mechanic_mexico", "type": "text", "text": { "body": "Hola, mi coche está averiado" } },
"slack": { "channel": "mechanic_mexico", "text": "Hola, mi coche está averiado" }
}
}
```
## 🌟 Real-World Use Cases
1. **Marketplace Communication**: Mongolian buyer ↔ Spanish mechanic
2. **International Business**: English CEO ↔ Japanese partners
3. **Customer Support**: Any language ↔ Support team language
4. **Gaming Communities**: Players from different countries
5. **Social Networks**: Global friend connections
## 📞 Get Your FluentAPI Key
Visit [https://www.fluentapi.io/pricing.html](https://www.fluentapi.io/pricing.html) to get your FluentAPI key.
**Important:** You need a FluentAPI key (starts with `fluent_live_sk_`), not Google/Stripe keys. All Google Translate and Stripe processing happens on our secure servers.
## 🤝 Contributing
We welcome contributions! Please see our [GitHub repository](https://github.com/fluent-api/fluent-api) for more details.
## 📄 License
MIT License - see LICENSE file for details.