Rust

Installation

To add the Connect Framework Rust SDK to your project, include it in Cargo.toml:

[dependencies]
connect-framework = "0.8"

Then, import the crate in your code:

use connect_framework::ConnectFramework;

Usage

Initializing the SDK

Before making any API calls, you must initialize the SDK with your API key.

// Initialize the SDK with an API key
ConnectFramework::initialize("your_api_key_here");

User Authentication

Logging in with a Unique ID and Email

Logs in the user using a unique ID and an email. If unique_id is None, a new one will be generated automatically. The callback is executed when the login process completes.

Submitting an OTP Code

If the login process requires an OTP (One-Time Password), this function submits the OTP code for verification.

Logging Out

Logs out the user entirely.

Checking if User is Connected

Returns true if the user is logged in and running the Connect.ai desktop client.


Analytics Tracking

Logging an Event

Logs an analytics event with a category and action.

Logging an Event with Additional Data

Logs an analytics event with a category, action, label, and numerical value.

Last updated