@eml-payments/client-sdk
v1.1.1
Published
> A comprehensive TypeScript SDK for the Arlo Client Portal BFF API
Keywords
Readme
Arlo Client SDK
A comprehensive TypeScript SDK for the Arlo Client Portal BFF API
🚀 Overview
The Arlo Client SDK provides a clean, type-safe interface for all Client Portal operations, integrating seamlessly with @eml-payments/core-sdk for authentication. It covers all BFF API endpoints with a modular, service-based architecture.
Key Features
- ✅ Full TypeScript Support - Complete type safety
- ✅ CoreSDK Integration - OAuth/Azure AD handled automatically
- ✅ 19 API Endpoints - Complete BFF coverage
- ✅ 40+ Methods - All Client Portal operations
- ✅ Modular Services - Clean, testable architecture
- ✅ Production Ready - Error handling, logging, validation
📦 Installation
npm install @eml-payments/client-sdkRequired peer dependency:
npm install @eml-payments/core-sdk🔧 Quick Start
import { Client } from "@eml-payments/client-sdk";
// Initialize the SDK
const client = new Client("https://your-bff-api.com");
// Login (redirects to Azure AD)
client.login();
// Get current user
const user = await client.getMe();
// Get dashboard
const dashboard = await client.getDashboard();
// Logout
await client.logout();📚 Documentation
For detailed documentation, see:
- CLIENT_SDK_IMPLEMENTATION.md - Complete API reference and examples
- CLIENT_SDK_SUMMARY.md - Implementation details and architecture
🎯 Core Capabilities
Authentication (via CoreSDK)
client.login(); // Redirect to Azure AD
const user = await client.getMe(); // Get current user
await client.logout(); // LogoutDashboard
const dashboard = await client.getDashboard();
const metrics = await client.getDashboardAmount({ timeFrame: "24h" });Account Operations
const account = await client.getAccount(accountId);
const transactions = await client.getAccountTransactions(accountId);
const cards = await client.getAccountCards(accountId);Fund Transfers
await client.transferFunds({
fromAccountId: "account-uuid",
toEndUserEmail: "[email protected]",
amount: 100.0,
});User Management
const users = await client.getPortalUsers({ pageNo: 1, pageSize: 10 });
await client.createPortalUser(clientId, { loginEmail: "[email protected]" });
await client.createEndUser({ name: "John Doe", email: "[email protected]" });🏗️ Architecture
Service Modules
ClientSDK
├── AuthService → Authentication (CoreSDK)
├── DashboardService → Dashboard data & metrics
├── ClientService → Client operations
├── AccountService → Account operations
├── CardService → Card operations
├── PortalUserService → Portal user management
├── EndUserService → End user management
├── TransactionService → Transaction operations
├── TransferService → Fund transfers
└── ParentAccountService → Parent account info🔐 Authentication Flow
- Frontend calls
client.login()→ Redirects to Azure AD - Azure AD authenticates → Redirects to BFF callback
- BFF validates token → Sets secure HTTP-only cookie
- CoreSDK automatically includes cookie in all requests
- BFF validates cookie for each API request
No token management needed - CoreSDK handles everything!
📊 API Coverage
| Category | Endpoints | Status | | -------------- | --------- | ------ | | Authentication | 2 | ✅ | | Dashboard | 2 | ✅ | | Client | 3 | ✅ | | Account | 3 | ✅ | | Card | 1 | ✅ | | Portal User | 3 | ✅ | | End User | 1 | ✅ | | Transaction | 1 | ✅ | | Transfer | 2 | ✅ | | Parent Account | 1 | ✅ | | Total | 19 | ✅ |
🎨 Usage Examples
Dashboard Component
async function loadDashboard() {
const dashboard = await client.getDashboard();
const metrics = await client.getDashboardAmount({ timeFrame: "24h" });
return { dashboard, metrics };
}Transfer Component
async function transferFunds(
fromAccountId: string,
email: string,
amount: number
) {
return await client.transferFunds({
fromAccountId,
toEndUserEmail: email,
amount,
description: "Fund transfer",
});
}User Management
async function createNewUser(clientId: string, email: string) {
return await client.createPortalUser(clientId, {
loginEmail: email,
firstName: "John",
lastName: "Doe",
});
}🛠️ Development
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Lint
npm run lint📦 Exports
// Main client
import { Client, ClientSDK } from "@eml-payments/client-sdk";
// Services
import {
AuthService,
DashboardService,
ClientService,
AccountService,
CardService,
PortalUserService,
EndUserService,
TransactionService,
TransferService,
ParentAccountService,
} from "@eml-payments/client-sdk";
// Types
import type {
UserWithProduct,
DashboardResponse,
TransactionViewModel,
// ... and 30+ more types
} from "@eml-payments/client-sdk";🔗 Related Projects
- @eml-payments/core-sdk - Core authentication SDK
- @eml-payments/enduser-sdk - End User Portal SDK
- arlo.client.portal - Client Portal
🤝 Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.
📄 License
MIT
Built with ❤️ by the EML Payments Team
