SDK Overview
Nadi provides official SDKs for multiple platforms, making it easy to integrate error monitoring into your applications.
Available SDKs
| SDK | Package | Requirements | Status |
|---|---|---|---|
| Laravel | nadi-pro/nadi-laravel | PHP 8.1+, Laravel 9+ | Stable |
| PHP | nadi-pro/nadi-php | PHP 8.1+ | Stable |
| WordPress | nadi-pro/nadi-wordpress | PHP 8.1+, WP 5.0+ | Stable |
| JavaScript | @nadi-pro/browser | Modern browsers | Stable |
| CakePHP | nadi-pro/nadi-cakephp | PHP 8.1+, CakePHP 4.5+/5.x | Stable |
| CodeIgniter | nadi-pro/nadi-codeigniter | PHP 8.1+, CodeIgniter 4.3+ | Stable |
| Yii 3 | nadi-pro/nadi-yii | PHP 8.1+, Yii 3 | Stable |
| Yii 2 | nadi-pro/nadi-yii2 | PHP 8.1+, Yii 2.0.45+ | Stable |
| Drupal | nadi-pro/nadi-drupal | PHP 8.1+, Drupal 10.1+/11 | Stable |
Choosing an SDK
Laravel Applications
Use the Laravel SDK for Laravel applications. It provides:
- Automatic exception handling integration
- Laravel-specific context (routes, middleware, queues)
- Artisan commands for setup and testing
- Blade error pages integration
- Queue job monitoring
composer require nadi-pro/nadi-laravel
php artisan nadi:installPHP Applications
Use the PHP SDK for any PHP application:
- Framework-agnostic design
- Multiple transporter options (file, HTTP)
- Flexible sampling strategies
- PSR-3 logger integration
composer require nadi-pro/nadi-phpWordPress Sites
Use the WordPress Plugin for WordPress sites:
- One-click installation
- Admin UI for configuration
- WooCommerce integration Coming Soon
- WordPress-specific context
Browser Applications
Use the JavaScript SDK for browser applications:
- Automatic error capturing
- Web Vitals monitoring
- Breadcrumb tracking
- Session replay Coming Soon
- Framework integrations (React, Vue, Angular, Next.js) Coming Soon
npm install @nadi-pro/browserJavaScript SDK Documentation →
CakePHP Applications
Use the CakePHP SDK for CakePHP applications:
- Plugin-based integration
- Automatic exception capturing
- CakePHP-specific context (controllers, actions)
- Cake console commands for setup and testing
composer require nadi-pro/nadi-cakephp
cake nadi:installCodeIgniter Applications
Use the CodeIgniter SDK for CodeIgniter 4 applications:
- Service and filter-based integration
- Automatic exception capturing
- CodeIgniter-specific context (controllers, methods)
- Spark commands for setup and testing
composer require nadi-pro/nadi-codeigniter
php spark nadi:installCodeIgniter SDK Documentation →
Yii 3 Applications
Use the Yii 3 SDK for Yii 3 applications:
- DI container integration
- Middleware-based exception capturing
- OpenTelemetry support
- Yii-specific context
composer require nadi-pro/nadi-yiiYii 2 Applications
Use the Yii 2 SDK for Yii 2 applications:
- Component-based integration
- Bootstrap integration for automatic setup
- Yii 2-specific context (controllers, actions)
- Console application support
composer require nadi-pro/nadi-yii2Drupal Sites
Use the Drupal SDK for Drupal sites:
- Module-based installation
- Admin UI for configuration
- Drupal-specific context (routes, services)
- Drush commands for setup and testing
composer require nadi-pro/nadi-drupal
drush en nadiCore Concepts
All Nadi SDKs share common concepts:
Events
Events are the primary data structure in Nadi. Types include:
- Exceptions - Captured errors and exceptions
- Messages - Manual log messages
- Breadcrumbs - User actions and navigation
- Performance - Web Vitals and timing data
Context
Context enriches events with additional information:
- User - Current user details
- Tags - Key-value pairs for filtering
- Extra - Additional arbitrary data
- Request - HTTP request details
Sampling
Sampling controls what percentage of events are captured:
- Fixed Rate - Capture X% of all events
- Dynamic Rate - Adjust based on load
- Interval - Capture at time intervals
- Peak Load - Increase during high traffic
Transporters
Transporters determine how events are sent:
- File - Write to local log files (recommended)
- HTTP - Send directly to Nadi API
Recommended Setup
Use the file transporter with Shipper for best reliability. This approach handles network issues gracefully and doesn't block your application.
SDK Architecture
Next Steps
Choose the SDK for your platform:
- Laravel SDK - Full-featured Laravel integration
- PHP SDK - Framework-agnostic PHP client
- JavaScript SDK - Browser error tracking
- WordPress SDK - WordPress plugin
- CakePHP SDK - CakePHP integration
- CodeIgniter SDK - CodeIgniter 4 integration
- Yii 3 SDK - Yii 3 integration
- Yii 2 SDK - Yii 2 integration
- Drupal SDK - Drupal module