The SDK is a singleton — initialize once, import the same orwel instance anywhere. Every method is safe to call after init().
Methods
init options
Validation
The SDK validates inputs at runtime and throws descriptive errors:
apiKey must start with orwel_ and be ≥ 20 characters.
- Event codes match
^[a-z0-9_]{1,50}$.
- Emails inside properties / traits are validated — pass valid addresses or omit the field.
One instance. Never re-initialize. Import orwel from your wrapper module everywhere; the visitor + session are managed for you and persist across reloads.