where to add PnPTelemetry code in SPFX PnP solution

%3CLINGO-SUB%20id%3D%22lingo-sub-2552426%22%20slang%3D%22en-US%22%3Ewhere%20to%20add%20PnPTelemetry%20code%20in%20SPFX%20PnP%20solution%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2552426%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%3C%2FP%3E%3CP%3EI%20need%20to%20include%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EPnP%20Telemetry%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20my%20code.%20I%20am%20working%20on%20SPFX%20React%20based%20solution.%20I%20haven't%20used%20it%20before.%20Can%20you%20guide%20me%20where%20to%20use%26nbsp%3B%20below%20lines%20of%20code%2C%20in%20Constructor%20or%20render%20method%3F%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Econst%20telemetry%20%3D%20PnPTelemetry.getInstance()%3B%0Atelemetry.optOut()%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%3EThis%20is%20one%20of%20app%20deployment%20requirement%2C%20haven't%20found%20much%20documentation%20about%20it.%20Will%20apricate%20your%20help%20on%20this.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2552426%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EReact%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESPFx%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

Hi all,

I need to include PnP Telemetry in my code. I am working on SPFX React based solution. I haven't used it before. Can you guide me where to use  below lines of code, in Constructor or render method?

const telemetry = PnPTelemetry.getInstance();
telemetry.optOut();

This is one of app deployment requirement, haven't found much documentation about it. Will apricate your help on this.

0 Replies