Javascript (Client-side)
schematic-js
is a client-side JavaScript SDK for tracking event-based usage, identifying users, and checking flags using Schematic.
Install
Usage
You can use Schematic to identify users; after this, your subsequent track events and flag checks will be associated with this user.
By default, checkFlag
will perform a network request to get the flag value for this user. If you’d like to check all flags at once in order to minimize network requests, you can use checkFlags
:
Alternatively, you can run in websocket mode, which will keep a persistent connection open to the Schematic service and receive flag updates in real time:
Troubleshooting
For debugging and development, Schematic supports two special modes:
Debug Mode
Enables console logging of all Schematic operations:
Offline Mode
Prevents network requests and returns fallback values for all flag checks:
Offline mode automatically enables debug mode to help with troubleshooting.
License
MIT
Support
Need help? Please open a GitHub issue or reach out to support@schematichq.com and we’ll be happy to assist.