InvergeDocs

Switching services off

Turn any Nexus product off with an environment variable or one line of config — without removing the code that uses it.

Every product is on by default. Switching one off makes it inert: it makes no network call, never throws, and returns a neutral value — flags fall back to your defaults, Remote Config to your defaults, lists are empty, events and logs are not even buffered, and background work (sockets, recorders, error handlers) does not start. Your code keeps compiling and running unchanged.

NEXUS_LIVE_ACTIVITIES_ENABLED=false   # just Live Activities
NEXUS_ENABLED=false                   # everything — handy in tests and CI
VariableSwitches offJS keyPHP / Python key.NET NexusServices.
NEXUS_REALTIME_ENABLEDrooms, emits, the socketrealtimerealtimeRealtime
NEXUS_EVENTS_ENABLEDeventseventseventsEvents
NEXUS_ERRORS_ENABLEDerror captureerrorserrorsErrors
NEXUS_LOGS_ENABLEDlogslogslogsLogs
NEXUS_SESSIONS_ENABLEDsessionssessionssessionsSessions
NEXUS_FLAGS_ENABLEDfeature flags (→ defaults)flagsflagsFlags
NEXUS_REMOTE_CONFIG_ENABLEDRemote Config (→ defaults)remoteConfigremote_configRemoteConfig
NEXUS_LINKS_ENABLEDdeep linkslinkslinksLinks
NEXUS_SURVEYS_ENABLEDsurveyssurveyssurveysSurveys
NEXUS_PUSH_ENABLEDpushpushpushPush
NEXUS_IN_APP_ENABLEDin-app messagesinAppin_appInApp
NEXUS_LIVE_ACTIVITIES_ENABLEDLive ActivitiesliveActivitieslive_activitiesLiveActivities
NEXUS_REPLAY_ENABLEDsession replayreplayreplayReplay
NEXUS_VOICE_ENABLEDvoice—voice (Python)Voice
NEXUS_TELESCOPE_ENABLEDTelescope request tracingtelescope (Node)telescopeTelescope

false, 0, off and no all mean off.

In code

Nexus.init({ apiKey, services: { liveActivities: false } });
Nexus.init({ apiKey, enabled: false });   // everything
nexus.enabled('push');                    // → boolean

In the browser there is no environment, so this is the only way.

Off wins

A service is on only if neither the code nor the environment turns it off. That means operations can always switch a product off in an incident with an environment variable, whatever the code says. Unknown service names are rejected, so a typo cannot silently leave something on.

On this page