Search code examples
angularauth0

How do I add to Auth0 to the build system in Angular?


I'm following along with the Getting Started tutorial with Auth0 for Angular, and I'm not quite sure what part of a specific instruction means:

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

I'm just getting started with both Angular and Auth0, so I assume this is a fairly trivial task, however I can't seem to find anything on how to specifically go about this. I'm somewhat familiar with bundling services to the point I'm pretty sure that is what is involved. But from there, I'm not sure which files are involved.

I have a fresh install of Angular from Angular-cli, and have installed auth0 with

npm install --save auth0-js

Solution

  • From @Andresson's link, it seems like the way to add it to the build system is in the .angular-cli.json file under the scripts property. I need added the following and seem to be getting the intended results

      "scripts": [
        "../node_modules/auth0-js/build/auth0.js"
      ]