kalizi/laravel-spyhole
Composer 安装命令:
composer require kalizi/laravel-spyhole
包简介
Laravel package to record and re-watch user sessions
关键字:
README 文档
README
Laravel Spyhole is a user session recorder for the Laravel Framework. Laravel Spyhole is a wrapper for the JS Library RRWeb (Record and replay the web). It allows a simple way to embed the Recorder into your views and start recordings out-of-the-box.
Installation
You can install the package via composer:
composer require kalizi/laravel-spyhole
Usage
After installation publish the config file:
php artisan vendor:publish --provider="Kalizi\LaravelSpyhole\LaravelSpyholeServiceProvider"
In the configuration file you can set:
- Session ID tracking: this will make the package track the session ID from the Laravel built-in Session, if set to false, a random UUID will be generated for the user session.
- User ID tracking: this will make the package track the user ID with recordings.
- Minimum sampling rate: the minimum number of records to be recorded from frontend before sending. (Default: 50)
Finally, to start recording, just embed the recorder view to the view you want to record.
@include("laravel-spyhole::embed_spyhole")
How it works in short
As pointed before, spyhole uses RRWeb as its internal recorder.
In the resources/assets folder there are the published assets where you can find the RRWeb files and the built version of recording-handler.js, a JS script handling the RRWeb initialization and recording sendings.
The recordings are posted to a route named spyhole.store-entry (whose URL is /spyhole-api/record). Recordings are accessible via the model Kalizi\LaravelSpyhole\Models\SessionRecording with properties: ID, path, recordings (an array stored gzipped and base 64 encoded) and user ID.
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email me@kalizi.dev instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.
kalizi/laravel-spyhole 适用场景与选型建议
kalizi/laravel-spyhole 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 52 次下载、GitHub Stars 达 6, 最近一次更新时间为 2021 年 02 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「kalizi」 「laravel-spyhole」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kalizi/laravel-spyhole 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kalizi/laravel-spyhole 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-02-07