The browserless SDK lets you use the same JavaScript methods as the standard JS SDK. Therefore, there is no dedicated documentation for this SDK; it is a list of the core differences and everything else stays the same.
You can find further information on these core differences in our developer documentation: Javascript (browserless) | Piano Analytics Developers Documentation (atinternet-solutions.com)
The browserless SDK does not offer permanent storage of the data and information natively stored in cookies (as it is meant to be used for applications that do not render in a browser). It also does not provide any of the properties that rely on a browser API to be set.
This being said, the browserless SDK still stores data for the duration of the active session (so while the application is running) in a variable called "localVariable".
The "localVariable" used to store data in a browserless mode, stores the equivalent of what is stored in our cookies, so the privacy mode, the visitor ID, and the user ID.
All the stored data cannot be directly accessed, but our SDK provides a series of methods to manage this data:
- For privacy, this will be the
pa.privacy.getMode()
andpa.privacy.setMode()
: Privacy | Piano Analytics Developers Documentation (atinternet-solutions.com) - For visitor identification (idclient), it will be the methods
pa.getVisitorId()
orpa.setVisitorId()
: Visitor identification | Piano Analytics Developers Documentation (atinternet-solutions.com) - And for users, it will be the methods
pa.getUser()
andpa.setUser()
: Users | Piano Analytics Developers Documentation (atinternet-solutions.com)
The stored data however does not persist when the application is stopped. If you wish to retain those pieces of information for a longer time, the application must persistently store the visitor ID, for example, itself to force it using the method pa.setVisitorId()
the next time the program is launched. The same applies to the other types of stored data.
Please note that we recommend the usage of this browserless SDK if you are developing in pure server environments. If you can access the browser APIs however, you should use the standard SDK and not the browserless one, even if you are technically still in a server environment.