Available SDKs
Brevo
Email marketing, transactional emails, and SMS
Dropbox
File storage, sharing, and management
HubSpot
CRM, marketing automation, and contact management
Harvest
Time tracking and project management
Additional SDKs including Business Central, Fortnox, and Notion are available in the codebase. Documentation coming soon.
Architecture
All SDKs follow a consistent, layered architecture pattern designed for maintainability, performance, and ease of use.Architecture Flow
Core Components
Service Class
Main Entry PointThe primary interface for SDK interactions. Uses the
WithResources trait to provide organized access to all API functionality.Connector
HTTP ClientHandles HTTP connections, authentication, and request/response lifecycle using Saloon. Manages timeouts, retries, and error handling.
Resources
API OrganizationGroup related API methods into logical units (contacts, lists, emails). Keeps the service class clean and methods discoverable.
Requests
Endpoint DefinitionsDefine individual API endpoints with parameters, query strings, and body data. Implement
Paginatable for automatic pagination.Raw JSON
PerformanceReturns direct JSON responses from the API without transformation overhead. Maximum performance with minimal processing.
Collections
Data HandlingLaravel Collections wrapping raw arrays. Provides powerful data manipulation methods while maintaining performance.
Architecture Layers
Application Layer
Your Laravel application interacts with the Service Class using dependency injection or direct instantiation. The service class provides a clean, fluent API for all SDK operations.
Resource Layer
Resource Classes organize related API methods into logical groups (contacts, lists, emails). This prevents the main service class from becoming bloated and improves discoverability.
Transport Layer
The Connector handles all HTTP communication through Saloon, managing authentication, timeouts, retries, and error handling automatically.
Request Layer
Request Classes define individual API endpoints with their specific parameters, headers, and body data. They implement pagination interfaces where applicable.
Common Patterns
Initialization
All SDKs follow the same initialization pattern:Resource-Based API
SDKs organize functionality into logical resources:Return Types
All SDK methods follow consistent return types: | Method Pattern | Return Type | Description | | -------------- | ------------ | --------------------------------------- | ------------------------------------- | |list() | Collection | Returns all items as Laravel Collection |
| get($id) | array | Returns single item as array |
| create() | array | Returns created item data |
| update() | void | array | Updates item, may return updated data |
| delete() | void | Deletes item |
| paginate() | Paginator | Returns paginator for manual control |
Pagination
SDKs handle pagination automatically inlist() methods:
Error Handling
All SDKs use Saloon’sAlwaysThrowOnErrors trait for consistent error handling:
Configuration
Each SDK has a corresponding configuration file inconfig/{service}.php:
Environment Variables
Add credentials to your.env file:
Laravel Integration
Service Container Registration
For optimal Laravel integration, register SDKs as singletons in yourAppServiceProvider. The Inly Core package provides a stub file with examples for all available SDKs.
Reference file: vendor/inly/core/stubs/laravel/app/Providers/AppServiceProvider.php
Copy the relevant SDK registration from the stub to your application’s app/Providers/AppServiceProvider.php:
Dependency Injection
Once registered as a singleton, inject SDKs directly into your classes:Benefits of Singleton Registration
- Single Instance - One configured instance shared across your application
- Auto-Configuration - Automatically loads credentials from config
- Type Hinting - Full IDE support with dependency injection
- Testability - Easy to mock in tests
- Performance - No repeated instantiation or configuration
Testing
Each SDK includes a test command for verifying configuration:- ✅ Verify credentials are configured
- ✅ Test API connectivity
- ✅ Display sample data from your account
Performance
Our SDKs are optimized for performance:- Raw JSON responses: No unnecessary data transformation overhead
- Automatic pagination: Efficiently fetches all pages
- Connection pooling: Reuses HTTP connections
- Configurable timeouts: Prevent hanging requests
- Rate limit handling: Automatic retry with backoff (where supported)
Building Your Own SDK
Want to integrate a new service? Check out our Saloon SDK Implementation Guide for step-by-step instructions on building production-ready SDKs following our patterns.Reference Implementations
Study these existing SDKs as templates for your implementation:Brevo SDK
Best for: Simple token-based authenticationSimple API key authentication with organized resources for contacts, lists, and emails.
Dropbox SDK
Best for: OAuth 2.0 with token refreshFull OAuth 2.0 flow with automatic token refresh and cursor-based pagination.
HubSpot SDK
Best for: Complex search and filteringFluent search filter API with type-safe operators and complex CRM operations.
Harvest SDK
Best for: Multi-credential authenticationRequires both access token and account ID with comprehensive resource management.
Quick Start Template
Best Practices
1. Always Check Configuration
2. Use Try-Catch for API Calls
3. Batch Operations Efficiently
4. Cache Responses When Appropriate
5. Use Resource Methods, Not Raw Requests
Rate Limiting
Each third-party service has different rate limits. Check the individual SDK documentation for specific limits and how to handle them.General Guidelines
- Process large datasets in chunks
- Add delays between batches
- Handle
429 Too Many Requestserrors gracefully - Use queued jobs for bulk operations
- Monitor your API usage in the service dashboard
Support
For SDK-related questions:- Check the specific SDK documentation
- Review the Saloon SDK Implementation Guide
- Check the third-party service’s API documentation
- Contact the Inly Core team