{"id":15195302,"url":"https://github.com/holidaycheck/auth0-bundler","last_synced_at":"2025-10-02T10:32:10.542Z","repository":{"id":19828031,"uuid":"87829882","full_name":"holidaycheck/auth0-bundler","owner":"holidaycheck","description":"Bundle rules, scripts and hooks to deploy them to Auth0.","archived":true,"fork":false,"pushed_at":"2023-04-13T12:02:28.000Z","size":249,"stargazers_count":8,"open_issues_count":19,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-10T20:12:07.080Z","etag":null,"topics":["auth0"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holidaycheck.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-10T15:54:01.000Z","updated_at":"2023-04-13T12:05:53.000Z","dependencies_parsed_at":"2024-09-23T21:05:31.085Z","dependency_job_id":"758b7413-b9b1-49bf-a266-7f402fb6cac6","html_url":"https://github.com/holidaycheck/auth0-bundler","commit_stats":{"total_commits":180,"total_committers":8,"mean_commits":22.5,"dds":0.5,"last_synced_commit":"56a18a69b4613fccf291c3bbecf963548d902f97"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holidaycheck%2Fauth0-bundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holidaycheck%2Fauth0-bundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holidaycheck%2Fauth0-bundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holidaycheck%2Fauth0-bundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holidaycheck","download_url":"https://codeload.github.com/holidaycheck/auth0-bundler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234975104,"owners_count":18916157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth0"],"created_at":"2024-09-27T23:21:12.511Z","updated_at":"2025-10-02T10:32:10.225Z","avatar_url":"https://github.com/holidaycheck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# auth0-bundler\n\nThe project was not updated for two years and does not even support Node 16, which is required by Auth0 now. We decided to archive this project to make it clear, that no updates for this library can be expected any more.\n\n[![NPM version][npm-image]][npm-url]\n[![Build status][travis-ci-image]][travis-ci-url]\n[![License][license-image]][license-url]\n\nBundle [rules](https://auth0.com/docs/rules), [scripts](https://auth0.com/docs/connections/database/mysql#3-provide-action-scripts) and [hooks](https://auth0.com/docs/hooks) to deploy them to Auth0.\n\nThis allows you to\n- test rules, scripts and hooks dedicated to be deployed to Auth0, as they can be required in node as well.\n- import other modules by using `require` statements with relative file paths. This way common functionality can be shared between rules.\n- write your rules using the whole ES2015 feature set, as the rules will be transpiled at bundle time.\n- pass in configuration at bundling time which can be used in your rule when it is executed.\n\n## API\n\n### `createBundler`\n\n```\nconst createBundler = require('auth0-bundler');\n\nconst bundler = createBundler(options);\n```\n\n#### Options\n\n* `nodeVersion`: the node version that should be targeted (used for `@babel/preset-env`), the default is `4`\n\n### bundler.bundleScript(injectedConfig, scriptFilename) -\u003e Promise\\\u003cbundledScript\\\u003e\n### bundler.bundleRule(injectedConfig, ruleFilename) -\u003e Promise\\\u003cbundledRule\\\u003e\n### bundler.bundleHook(injectedConfig, hookFilename) -\u003e Promise\\\u003cbundledHook\\\u003e\n\nBundles a single script, rule or hook so it can be deployed to Auth0. The rule needs to be written as a commonjs\nmodule that exports a single function. This function takes an additional first parameter compared to being defined in Auth0: The `injectedConfig` that can be specified at bundle time. Modules required from the `node_modules` folder will not be bundled and will be required in the Auth0 environment as well. Auth0 provides a number of modules inside the Auth0 environment, to check whether a module can be required check [webtaskio-canirequire](https://tehsis.github.io/webtaskio-canirequire/).\n\n__Example__:\n\nRule:\n\n```js\n// my-rule.js\n// Example rule to be deployed to auth0\n\n// This dependency will be automatically bundled into the rule\nconst doRequest = require('../common/function');\n// This dependency will be loaded using require\nconst R = require('ramda');\n\nmodule.exports = function myRule(config, user, context, callback) {\n    return doRequest(`${config.baseUrl}/some/endpoint`, user).then(function (result) {\n        callback(null, R.merge({ some: 'result' }, result), context);\n    });\n};\n```\n\nBundle dependencies:\n\n```js\nconst createBundler = require('auth0-bundler');\nconst bundler = createBundler();\nconst config = { baseUrl: 'https://www.example.com' };\n\nbundler\n    .bundleRule(config, `${__dirname}/my-rule.js`)\n    .then(console.log);\n```\n\n\n\n## Using auth0-bundler during deployment\n\nThis is an example on how to use auth0-bundler and the Auth0 Management API client to automatically\ndeploy a rule using auth0-bundler. Like this you can automatically deploy rules e.g. during a\nCI run.\n\n```js\nconst ManagementClient = require('auth0').ManagementClient;\nconst management = new ManagementClient({\n  token: '{YOUR_API_V2_TOKEN}',\n  domain: '{YOUR_ACCOUNT}.auth0.com'\n});\nconst createBundler = require('auth0-bundler');\nconst bundler = createBundler();\nconst config = { baseUrl: 'https://www.example.com' };\n\nbundler.bundleRule(config, `${__dirname}/my-rule.js`).then((bundledRule) =\u003e {\n    return management.createRule({\n        enabled: true,\n        name: 'my-rule',\n        order: 1,\n        stage: 'login_success',\n        script: bundledRule\n    });\n});\n```\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n\n[npm-image]: https://img.shields.io/npm/v/auth0-bundler.svg\n[npm-url]: https://npmjs.org/package/auth0-bundler\n[travis-ci-image]: https://img.shields.io/travis/holidaycheck/auth0-bundler/master.svg\n[travis-ci-url]: https://travis-ci.org/holidaycheck/auth0-bundler\n[license-image]: http://img.shields.io/npm/l/auth0-lock.svg\n[license-url]: #license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholidaycheck%2Fauth0-bundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholidaycheck%2Fauth0-bundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholidaycheck%2Fauth0-bundler/lists"}