Skip to content

@tripo3d/lens / index / IdentityPlugin

Class: IdentityPlugin ​

Defined in: src/plugins/identity/index.ts:9

身份绑定插件:订阅 Core 的 user.identified 信令(由 L1 identify() 触发),把 device↔user 绑定关系组装成身份事件经 ctx.emit 上报。 只 emit,上报成功通知由 L1 onReported 统一承担。不做前端去重:每次 identify() 都如实 emit,重复由后端幂等收敛。

Implements ​

Constructors ​

Constructor ​

ts
new IdentityPlugin(): IdentityPlugin;

Returns ​

IdentityPlugin

Properties ​

PropertyModifierTypeDefault valueDescriptionDefined in
namereadonly"identity"'identity'插件唯一名,重复注册报错src/plugins/identity/index.ts:10

Methods ​

setup() ​

ts
setup(ctx): void;

Defined in: src/plugins/identity/index.ts:20

注入上下文并订阅 user.identified;若身份在 init 前已写入(identify 早于 init),setup 时补发一次避免漏报

Parameters ​

ParameterType
ctxPluginContext

Returns ​

void

Implementation of ​

TracePlugin.setup


teardown() ​

ts
teardown(ctx): void;

Defined in: src/plugins/identity/index.ts:27

注销清理:destroy 时调用

Parameters ​

ParameterType
ctxPluginContext

Returns ​

void

Implementation of ​

TracePlugin.teardown

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