surfgeo/laravel-aireferral-sdk
Composer 安装命令:
composer require surfgeo/laravel-aireferral-sdk
包简介
Track AI bot traffic (ChatGPT, Claude, Perplexity) in Laravel applications
README 文档
README
Track AI bot traffic in your Laravel applications.
Installation
composer require surfgeo/laravel-aireferral-sdk
Quick Start
1. Publish Configuration
php artisan vendor:publish --tag=surfgeo-config
Or use the install command:
php artisan surfgeo:install
2. Configure Environment
Add to your .env file:
SURFGEO_SCRIPT_KEY=sk_your_key_here SURFGEO_ENABLED=true
3. Test Connection
php artisan surfgeo:test
Configuration
Full configuration options in config/surfgeo.php:
return [ 'script_key' => env('SURFGEO_SCRIPT_KEY', ''), 'endpoint' => env('SURFGEO_ENDPOINT', 'https://api.surfgeo.com/api/track'), 'enabled' => env('SURFGEO_ENABLED', true), 'timeout' => env('SURFGEO_TIMEOUT', 0.05), 'debug' => env('SURFGEO_DEBUG', false), 'async' => env('SURFGEO_ASYNC', false), 'excluded_paths' => ['/health-check', '/metrics'], 'excluded_environments' => ['local', 'testing'], ];
Usage
Automatic Tracking
The middleware automatically tracks all requests. No additional code needed.
Custom Tracking
Use the facade to track custom events:
use surfgeo\Laravel\Facades\surfgeo; surfgeo::track([ 'timestamp' => time(), 'path' => '/custom-event', 'method' => 'POST', 'user_agent' => request()->userAgent(), ]);
Features
- ✅ Auto-discovered service provider
- ✅ Laravel HTTP client integration
- ✅ Queue-based tracking (optional)
- ✅ Artisan commands (install, test)
- ✅ Facade for convenience
- ✅ Path and environment exclusions
- ✅ Debug logging
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-06