File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -6,13 +6,14 @@ declare function fetch(url: RequestInfo, init?: RequestInit): Promise<Response>
6
6
/** The famed Hello World plugin itself. */
7
7
const helloWorld : Plugin = {
8
8
setupPlugin : async ( { config } ) => {
9
- console . log ( 'Setting up the plugin!' )
10
- console . log ( config )
9
+ console . log ( `Setting up the plugin:\n${ config . greeting } ` )
11
10
} ,
12
11
processEvent : async ( event , { config, cache } ) => {
13
12
const counterValue = ( await cache . get ( 'greeting_counter' , 0 ) ) as number
14
13
cache . set ( 'greeting_counter' , counterValue + 1 )
15
- if ( ! event . properties ) event . properties = { }
14
+ if ( ! event . properties ) {
15
+ event . properties = { }
16
+ }
16
17
event . properties [ 'greeting' ] = config . greeting
17
18
event . properties [ 'greeting_counter' ] = counterValue
18
19
event . properties [ 'random' ] = await fetchTrulyRandomInteger ( )
You can’t perform that action at this time.
0 commit comments