How to use Neptune in different modes#
Depending on how you want the data to be stored and synchronized, you can use Neptune in five different connection modes.
For example, if you're debugging your code, you can use Neptune in such a way that no data is uploaded or stored at all.
||Tracked data is stored locally and synchronized separately in the background.|
||No data is stored locally or sent to Neptune.|
||Data is not sent to Neptune, but stored locally. Can later be synced manually.|
||Used to only fetch data from existing objects. Ensures that no data is added or changed.|
||Neptune waits for other calls to reach the server before executing a tracking call.|
Setting the connection mode#
You can set the mode through either an environment variable or an initialization parameter.
The environment variable is used if the
mode parameter is omitted from the
This can be a handy way to debug or "switch off" Neptune without modifying your code.
To set the connection mode for the tracking, provide it to the
mode argument of the initialization function:
To only enable querying and no logging of new data, you can initialize an object in read-only mode:
- Using Neptune ≫ How to use
sync()to ensure synchronous logging
- API ≫ Connection modes reference
- Help ≫ Debugging options