Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ npx cap sync
- Capacitor 3 is recommended for this version
- Version 1.0.0 will target Capacitor 4

## Usage

First need initialize plugin with you [writeKey](https://segment.com/docs/connections/find-writekey/), and then use track methods:

```ts
import { Segment } from '@joinflux/capacitor-segment'

Segment.initialize({
key: 'you write key',
})

// see API section with other methods
Segment.track({ eventName: 'Hello World'})
```

For prevent crashing app in HMR on init hook, recommended handling exception:

```ts
await Segment.initialize({
// ...
}).catch((e) => console.error(e))
```

## API

<docgen-index>
Expand Down