

Now to create the package.json file using npm, use the following command. Let us set up our development project.įire up your terminal/cmd, create a new folder named hello-world and open that folder using the cd command. npm makes it easy for us to set up this file. Whenever we create a project using npm, we need to provide a package.json file, which has all the details about our project. The above command will generate the following output −

Confirm that node and npm are installed by running the following commands in your terminal.
#Electron api on close install
If you do not already have these, head over to Node setup to install node on your local system. To get started with developing using the Electron, you need to have Node and npm(node package manager) installed. Electron is used by many companies like Microsoft, Github, Slack, etc.Įlectron has been used to create a number of apps. Github developed Electron for creating the text editor Atom. So all the electron apps are technically web pages running in a browser that can leverage your OS APIs. Instead, Electron uses web pages as its GUI, so you can also see it as a minimal Chromium browser, controlled by JavaScript. This does not mean Electron is a JavaScript binding to graphical user interface (GUI) libraries.
#Electron api on close how to
Now that you have configured Auth0, you can focus on learning how to secure an Electron application.

Leave this page open as you will need to copy a few values from it soon to integrate Auth0 in your app. Click on the Save Changes button at the bottom of the "Settings" page to complete the process. That's all the configuration you need to register your Electron application. Despite the URL structure, you don't need to have an actual server listening to it you just need to have your Electron application listening to it, as you will learn later on. Once done, Auth0 will invoke your allowed callback URL to take your users back to your application and inform it about the outcome: was authentication successful or not? For security reasons, Auth0 will only call URLs registered in the Allowed Callback URLs field. When your users click a login button in your user interface, your Electron app will redirect them to the Auth0 Universal Login page, where Auth0 will carry out the authentication process. When using Auth0 for user authentication, you don't need to build login or sign-up forms. Search for the Allowed Callback URLs field and put the following URL as its value: You are probably wondering what this URL is and why you need it. From there, click on the Settings tab to configure Auth0 to communicate with your Electron application. Once done, the Auth0 application page loads up. Provide a name for your application, such as "Auth0 Electron Demo".To start, open the Applications section of the Auth0 Dashboard and click on Create Application.
#Electron api on close free
If you don't have an Auth0 account yet, you can sign up for a free one right now. To use Auth0 with Electron, you need to register your Electron application with Auth0 and set up a communication bridge between them. Register an Electron Application with Auth0
