Skip to content

@tripo3d/lens / index / TripoLensParams

Interface: TripoLensParams ​

Defined in: src/trace.ts:30

TripoLens 构造参数

Properties ​

PropertyTypeDescriptionDefined in
appstringApp 段(必填):event_format 前缀,全插件共用;归一为合法坐标段(trim+小写 [a-z0-9_-]{1,32},非法回落 'tripo')src/trace.ts:32
beforeEmit?BeforeEmitHookL4 业务最后处理钩子:可改写或返回 null 丢弃事件src/trace.ts:34
configUrlstringCDN 白名单配置 JSON 的完整 URL(必填)src/trace.ts:36
debug?booleanDebug Bridge 三态开关(仅本地/测试):true 强开(动态加载 WindowBridgeTap 向 devtools 广播内部观测); false 硬关(覆盖运行期 flag——跑分/静默实例用,防止页面级 flag 让每条事件广播多条 postMessage); 缺省跟随运行期 flag localStorage['__tripo_lens_debug']='1' 或 window.TRIPO_LENS_DEBUG=true。src/trace.ts:43
deviceIdOverride?string显式传入 device id,跳过指纹计算(业务自管 id 时用)src/trace.ts:45
endpointstring完整上报地址(含路径);必传,由业务方给定(SDK 不再内置默认,避免误发测试环境)src/trace.ts:48
fetch?{ (input, init?): Promise<Response>; (input, init?): Promise<Response>; }自定义 fetch 实现,Nuxt 项目可传 $fetchsrc/trace.ts:51
onError?(err, ctx) => void错误回调,默认静默src/trace.ts:53
onReported?(type, payload) => void上报观测钩子:事件经 L4 进 L5 后触发,按 type 判别 payload。触发随优先级——P0 送达成功才触发、失败不触发;P1/P2 入队即触发;被 Pipeline 丢弃不触发src/trace.ts:55
plugins?TracePlugin[]追加装配的插件(attribution/identity 默认必装,此处为追加非替换;行为/错误/性能为 opt-in)src/trace.ts:59

基于 MIT 协议发布(内部使用)