Auth0 Home Blog Docs

How Lock.js and Auth0.js are uploaded to the CDN



How does the Jenkins build job makes the CDN bundle of lock available on each release?


All Auth0 libraries, that have a bundle uploaded to the CDN, should be placed using the following folder structure in the S3 bucket.


And taking Lock@10.0.0 as an example the path will be


Inside the directory we upload all the files needed like bundle, source maps, assets, etc.

Also we upload at most these different versions

  • full (major.minor.path)
  • latest minor (major.minor)
  • latest master (development)

All this is done using the library which checks what versions needs to upload and handles the upload to the S3 bucket

The configuration for Lock is (configured in package.json)

"cdn-component": {
  "name": "lock",
  "cdn": "",
  "mainBundleFile": "lock.min.js",
  "bucket": "",
  "localPath": "build"

and for auth0.js (also in its package.json)

"cdn-component": {
  "name": "auth0",
  "cdn": "",
  "mainBundleFile": "auth0.min.js",
  "bucket": "",
  "localPath": "build"

Using this information the library will first perform a HEAD to the cdn to check the existence of the current package version (from the package.json) of the mainBundleFile. If it exists it will only upload the contents of the localPath to the development version, otherwise will also upload the full and latest minor versions too.

The process currently is done by Jenkins in the following builds

that runs on every push to master branch of the Github repository and also runs test and linter.