Migrating Angular 1.x Applications From auth0.js v7 to v9

Versionv9

This guide includes all the information you need to update auth0.js from v7 to v9. Find out if you should upgrade or not by reading Migrating to Auth0.js v9.

Migration Steps

Update angular-auth0

Angular 1.x applications usually use the angular-auth0 packagewhen authenticating with Auth0. If you are using auth0.js v7, you should be using the v1 of that package. To use auth0.js v9 you need to update to the latest version (3.x).

You can update the angular-auth0 library using npm or yarn.

# installation with npm
npm install --save angular-auth0
 
# installation with yarn
yarn add angular-auth0

The script files need to be added to your build system, or added to the project with a script tag.

<script src="node_modules/angular-auth0/dist/angular-auth0.js"></script>

Update auth0.js

Update the Auth0.js library using npm or yarn.

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

# installation with yarn
yarn add auth0-js

Once updated, you can 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 do not want to use a package manager, you can retrieve Auth0.js from Auth0's CDN.

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

Next steps

The angular-auth0 library is just a thin wrapper over auth0.js, so you will need to adjust your code in the same way you do it when migrating a non-Angular project.

You can find instructions on how to do it in the How to migrate from Auth0.js v7 to v9.