Skip to main content

Getting the client script

Once the required elements are written into the prompt's HTML page, and assigned proper classes, all that is required is to include the library (and initialize if applicable).

Using <script> tag

For convenience, the pre-bundled, self-initializing electron-prompts-client script is available to download from JSDelivr:

It is recommended to download the js file, then load it in your page from a local file:

<script src="./path/to/electron-prompts-client.js"></script>

Using a module bundler

If your project is using a bundler such as Webpack, you can install electron-prompts-client using npm:

npm i electron-prompts-client

Then import and initialize it:

import ElectronPromptsClient from "electron-prompts-client"

const prompts = new ElectronPromptsClient()
await prompts.init()