Here you will see how to implement the Mellowtel library in your Electron project. Estimated time to complete: 3-5 minutes.
Before you start, make sure that:
To install the npm package, run the following command in your terminal:
Yarn
If you are using yarn as your package manager, run the following command:
There are two ways you can implement the library in your Electron application:
First, import the necessary dependencies and initialize Mellowtel in your main process (usually the file called: main.ts
):
It’s important to provide users with easy access to their Mellowtel settings. You can show the settings dialog using:
If you prefer to create your own consent interface, you can manually manage the opt-in/opt-out process.
The Mellowtel library for Electron provides the following methods. You can use this reference to understand how to interact with the library:
new Mellowtel(configurationKey: string)
Creates a new instance of the Mellowtel client.
requestConsent(window: BrowserWindow, rewardMessage?: string): Promise<boolean>
Shows the built-in consent dialog and returns whether the user opted in.
init(): Promise<void>
Initializes the Mellowtel service. Should be called after obtaining consent.
showConsentSettings(window: BrowserWindow): Promise<void>
Opens the Mellowtel settings dialog.
getOptInStatus(): boolean
Returns the current opt-in status.
optIn(): Promise<void>
Manually opts the user into the service.
optOut(): Promise<void>
Manually opts the user out of the service.
Need help? Join our Discord community for support.
Here you will see how to implement the Mellowtel library in your Electron project. Estimated time to complete: 3-5 minutes.
Before you start, make sure that:
To install the npm package, run the following command in your terminal:
Yarn
If you are using yarn as your package manager, run the following command:
There are two ways you can implement the library in your Electron application:
First, import the necessary dependencies and initialize Mellowtel in your main process (usually the file called: main.ts
):
It’s important to provide users with easy access to their Mellowtel settings. You can show the settings dialog using:
If you prefer to create your own consent interface, you can manually manage the opt-in/opt-out process.
The Mellowtel library for Electron provides the following methods. You can use this reference to understand how to interact with the library:
new Mellowtel(configurationKey: string)
Creates a new instance of the Mellowtel client.
requestConsent(window: BrowserWindow, rewardMessage?: string): Promise<boolean>
Shows the built-in consent dialog and returns whether the user opted in.
init(): Promise<void>
Initializes the Mellowtel service. Should be called after obtaining consent.
showConsentSettings(window: BrowserWindow): Promise<void>
Opens the Mellowtel settings dialog.
getOptInStatus(): boolean
Returns the current opt-in status.
optIn(): Promise<void>
Manually opts the user into the service.
optOut(): Promise<void>
Manually opts the user out of the service.
Need help? Join our Discord community for support.