JavaScript Getting Started

This integration guide will walk you through setting up and managing authentication and authorization in your JavaScript apps using Auth0.

Get Your Application Keys

When you signed up for Auth0, you were invited to create a new client.

There are some details about this client that your application needs to know about to properly communicate with Auth0, including your Client ID and Domain. You can retrieve these values from the settings area for your client in the Auth0 dashboard.

Please note that if you download the samples available for this tutorial, these keys will be pre-populated for you. If you have created more than one client in your account, the sample will come with the values for your Default App.

App Dashboard

Configure Callback URLs

A callback URL is a URL in your application where Auth0 redirects to after the user has authenticated. You need to whitelist a callback URL for your app in the Callback URLs field in your Client Settings. If no callback URLs are set, a mismatch error will be displayed when a user logs in.

Install auth0.js

Integrating Auth0 in your application requires the auth0.js library. Install it using npm or yarn.

# installation with npm
npm install --save auth0-js

# installation with yarn
yarn add auth0-js

Once auth0.js is installed, add it to your build system or bring it in to your project with a script tag.

<script type="text/javascript" src="node_modules/auth0-js/build/auth0.js"></script>

If you don't want to use a package manager, auth0.js can also be retrieved from Auth0's CDN.

<script src="https://cdn.auth0.com/js/auth0/8.7/auth0.min.js"></script>

Next Tutorial
2. Login
Use Auth0 for FREECreate free Account