Javascript (Client-side)
Installation
The schematic-js
SDK is hosted here. Use npm or your preferred package manager to install:
Once installed, you can submit requests using your publishable key.
If you prefer to install the client-side JavaScript library using a script tag, you can load it from our CDN using the following URL: https://cdn.schematichq.com/js/schematic.js
Initialization
Initialize the SDK in the following way:
Usage example
Once the SDK is initialized, you may submit requests. Below is an example of identifying a user and submitting a usage event to Schematic.
The Javasript SDK references companies or users by their Schematic ID using the id
key or by any key you have defined and passed to Schematic previously.
React Native
This library uses uuid. In order for this to work in a React native context, you must also provide a shim for crypto.getRandomValues as described in the uuid documentation.