This commit is contained in:
Korbs 2025-02-20 19:16:44 -05:00
parent 812080d74a
commit 574dffb08b
Signed by: Korbs
SSH key fingerprint: SHA256:Q0b0KraMldpAO9oKa+w+gcsXsOTykQ4UkAKn0ByGn5U
16 changed files with 282 additions and 1052 deletions

View file

@ -21,10 +21,10 @@ Initialize the SDK using your `App Key`:
```js
import { init } from '@sudovanilla/zalvena';
init('<YOUR_APP_KEY>');
init('<APPKEY>');
// If you selfhost, use this instead
init('<YOUR_APP_KEY', { host: 'https://zv.example.org' });
init('<APPKEY', { host: 'https://zv.example.org' });
```
The init function also supports an optional second parameter, which is an object with the `appVersion` property.
@ -37,7 +37,7 @@ Afterwards you can start tracking events with `trackEvent`:
import { trackEvent } from '@sudovanilla/zalvena';
trackEvent('connect_click');
trackEvent('play_music', {
name: 'Here comes the sun',
name: 'Here comes the sun',
});
```
@ -45,7 +45,7 @@ A few important notes:
1. The SDK will automatically enhance the event with some useful information, like the OS and other properties.
2. You're in control of what gets sent to Zalvena. This SDK does not automatically track any events, you need to call `trackEvent` manually.
- Because of this, it's generally recommended to at least track an event at startup
- Because of this, it's generally recommended to at least track an event at startup
3. You do not need to await the `trackEvent` function, it'll run in the background.
4. Only strings and numeric values are allowed on custom properties