Rename Aptabase to Zalvena, add development instructions
This commit is contained in:
parent
141ebd9399
commit
eabd4619ed
1 changed files with 35 additions and 6 deletions
41
README.md
41
README.md
|
@ -7,21 +7,24 @@ Fork of the JavaScript SDK for Aptabase, modified for SudoVanilla projects.
|
|||
|
||||
## Install
|
||||
|
||||
Install the SDK using npm or your preferred JavaScript package manager
|
||||
Install the SDK using bun or your preferred JavaScript package manager:
|
||||
|
||||
```bash
|
||||
npm add @sudovanilla/zalvena
|
||||
bun add @sudovanilla/zalvena
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
First you need to get your `App Key` from Aptabase, you can find it in the `Instructions` menu on the left side menu.
|
||||
First you need to get your `App Key` from Zalvena, you can find it in the `Instructions` menu on the left side menu.
|
||||
|
||||
Initialize the SDK using your `App Key`:
|
||||
|
||||
```js
|
||||
import { init } from '@sudovanilla/zalvena';
|
||||
init('<YOUR_APP_KEY>');
|
||||
|
||||
// If you selfhost, use this instead
|
||||
init('<YOUR_APP_KEY', { host: 'https://zv.example.org' });
|
||||
```
|
||||
|
||||
The init function also supports an optional second parameter, which is an object with the `appVersion` property.
|
||||
|
@ -33,25 +36,51 @@ Afterwards you can start tracking events with `trackEvent`:
|
|||
```js
|
||||
import { trackEvent } from '@sudovanilla/zalvena';
|
||||
trackEvent('connect_click');
|
||||
trackEvent('play_music', { name: 'Here comes the sun' });
|
||||
trackEvent('play_music', {
|
||||
name: 'Here comes the sun',
|
||||
});
|
||||
```
|
||||
|
||||
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 Aptabase. This SDK does not automatically track any events, you need to call `trackEvent` manually.
|
||||
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
|
||||
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
|
||||
|
||||
---
|
||||
|
||||
## Development
|
||||
|
||||
To get started, make sure you've already have git and [Bun](https://bun.sh/) installed.
|
||||
|
||||
Then, with Bun, install packages:
|
||||
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
Run test website:
|
||||
|
||||
```bash
|
||||
bun run test
|
||||
```
|
||||
|
||||
If you make any changes in `/packages/`, run the `build` command to update the test:
|
||||
|
||||
```bash
|
||||
bun run build
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
License for Zalvena
|
||||
|
||||
```
|
||||
MIT License
|
||||
MIT License NON-AI
|
||||
|
||||
Copyright 2025 SudoVanilla
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue