{"_id":"@australiangreens/auth0-actions-mgmtapi","_rev":"3-ec97e92776e46285813870451e5fae8a","name":"@australiangreens/auth0-actions-mgmtapi","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@australiangreens/auth0-actions-mgmtapi","version":"1.0.0","keywords":["auth0"],"author":{"name":"John Twyman"},"license":"MIT","_id":"@australiangreens/auth0-actions-mgmtapi@1.0.0","maintainers":[{"name":"ineffyble","email":"dev@effy.is"},{"name":"anthonyblond","email":"anthony@unfinishedteleporter.com"},{"name":"johntwyman","email":"john.twyman@greens.org.au"},{"name":"lukek-ag","email":"luke.kugelman@greens.org.au"},{"name":"peterkmurphy-ag","email":"peter.murphy@greens.org.au"}],"homepage":"https://github.com/australiangreens/auth0-actions-mgmtapi#readme","bugs":{"url":"https://github.com/australiangreens/auth0-actions-mgmtapi/issues"},"dist":{"shasum":"6eacaa9a5707de4c93738fab4954348e111e9af7","tarball":"https://registry.npmjs.org/@australiangreens/auth0-actions-mgmtapi/-/auth0-actions-mgmtapi-1.0.0.tgz","fileCount":3,"integrity":"sha512-Bci/dd0UdzDHdvmUNvSPGWvoS+1j68REw27UIGrq0/wi12gc4n4mFAZWZ/Ix0N6spgevNx3U5573fBZdDeTU3Q==","signatures":[{"sig":"MEQCIHXEiY6b8RaYrK5T7MRNo3XzEa+LhWUZoChg6BVT63OBAiAqFaCN7QuCo4AHcvLCF7FSnntFhCeFclVVfEoqU9fdzw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5422},"main":"index.js","gitHead":"44413a64634bc1b7291564982629c63a0aa17b34","private":false,"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"johntwyman","email":"john.twyman@greens.org.au"},"repository":{"url":"git+https://github.com/australiangreens/auth0-actions-mgmtapi.git","type":"git"},"_npmVersion":"10.9.0","description":"A helper library for using auth0's Management API within auth0 Actions","directories":{},"_nodeVersion":"18.20.4","dependencies":{"auth0":"^4.18.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/auth0-actions-mgmtapi_1.0.0_1739344198645_0.9013878233759363","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-02-12T07:09:58.531Z","modified":"2026-02-26T05:36:14.293Z","1.0.0":"2025-02-12T07:09:58.855Z"},"bugs":{"url":"https://github.com/australiangreens/auth0-actions-mgmtapi/issues"},"author":{"name":"John Twyman"},"license":"MIT","homepage":"https://github.com/australiangreens/auth0-actions-mgmtapi#readme","keywords":["auth0"],"repository":{"url":"git+https://github.com/australiangreens/auth0-actions-mgmtapi.git","type":"git"},"description":"A helper library for using auth0's Management API within auth0 Actions","maintainers":[{"email":"dev@effy.is","name":"ineffyble"},{"email":"anthony@unfinishedteleporter.com","name":"anthonyblond"},{"email":"john.twyman@greens.org.au","name":"johntwyman"},{"email":"webops@greens.org.au","name":"australiangreens-cicd"},{"email":"peter.murphy@greens.org.au","name":"peterkmurphy-ag"}],"readme":"# Auth0 Actions Management API helper\n\n## Introduction\n\nThis package is designed as a helper for custom code running inside\nAuth0 Actions.\n\nIt is often desirable to have custom Actions that invoke Auth0's Management API\nto update attributes of a user record. This package provides two features:\n\n- a simple method for creating a management API client object; and\n- caching the management API token in the Auth0 Actions cache.\n\nCaching the token means that it can be reused across all Actions in the same\nflow, thus reducing the number of M2M API tokens issued.\n\n**Note: you do not need this package if you only intend to update user app_metadata or user_metadata.**\n\nYou can use `api.user.setUserMetadata(name, value)` and `api.user.setAppMetadata(name, value)` for most user\nupdate concerns. This library is for uses beyond updating metadata (such as root-level user attributes).\n\n## Requirements\n\nThis package supports the following tooling versions:\n\n- auth0: `>= 4.18`\n- Node.js: `>=18`\n\n## Installation\n\nAdd this package as a dependency to your Actions as per the\n[Auth0 documentation on managing dependencies](https://auth0.com/docs/customize/actions/manage-dependencies).\n\nReference this package as `@australiangreens/auth0-actions-mgmtapi`.\n\n## Configuration\n\nThe package expects the following secrets exist in your Action:\n\n- `M2M_DOMAIN`\n- `M2M_CLIENT_ID`\n- `M2M_CLIENT_SECRET`\n- `audience`\n\nThe values for these secrets can be obtained from [the Machine-to-Machine Application you must create for\nyour Actions](https://auth0.com/docs/get-started/apis/create-m2m-app-test) to be able to use the management API at all.\n\n## Usage\n\nLoad the package at the top of your Action code:\n\n`const { createManagementClient } = require('@australiangreens/auth0-actions-mgmtmapi');`\n\nCreate your management client _inside your Action handler functions_. You must use the `await` keyword:\n\n`const managementClient = await createManagementClient(event.secrets, api.cache);`\n\nNote: you must create the client inside the handler functions to be able to properly\npass through the Action secrets and Action cache object to the function.\n\nUse your management client as per [Auth0's node-auth0 documentation](https://auth0.github.io/node-auth0/classes/management.ManagementClient.html).\n","readmeFilename":"README.md"}