Leanbase Help Center

Your Guide to Building Products Customers Love

Install Capacitor SDK

Leanbase makes it easy to capture data from your Capacitor app, no matter the platform. You can find out more in the plugin's documentation.

Installation

Run the following command to install the package:

After installing the package, you need to update your Capacitor project:

Configuration

To use the plugin, you need to call the setup(...) method with your Leanbase project API key and host which you can find in your project settings:

You pass in a host key to specify the Leanbase instance you want to send events to. The default host is https://us.i.leanbase.com.

Capturing events

You can send custom events using capture:

Tip: We recommend using a [object] [verb] format for your event names, where [object] is the entity that the behavior relates to, and [verb] is the behavior itself. For example, project created, user signed up, or invite sent.

Setting event properties

Optionally, you can include additional information with the event by including a properties object:

Group analytics

Group analytics enable you to associate the events for that person's session with a group (e.g. teams, organizations, etc.). 

To associate the events for this session with a group, call group():

To associate the events for this session with a group and update the properties of that group, include the groupProperties property:

The name is a special property which is used in the Leanbase UI for the name of the group. If you don't specify a name property, the group ID will be used instead.

Credits

This library was built by the Capawesome team. It is not maintained by the Leanbase core team. If you have any questions or issues, please create a discussion or an issue in the GitHub repository.