Skip to content

Commit 6e67a4c

Browse files
committed
Add comment about nullable access token
1 parent 613d9c2 commit 6e67a4c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Pixel/Pixel.php

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ final class Pixel
88
{
99
public string $id;
1010

11+
/**
12+
* The reasons for the access token being nullable:
13+
*
14+
* 1. If you only want to use client side tracking you don't need an access token
15+
* 2. It's not necessarily the case that the access token is present when you create the event,
16+
* but first available when you want to send the event, hence you populate it later
17+
* 3. There's the risk of having the access token being outputted in some user facing error message
18+
*/
1119
public ?string $accessToken;
1220

1321
public function __construct(string $id, string $accessToken = null)

0 commit comments

Comments
 (0)