### Set Up Auth0 Deploy CLI Development Environment Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/how-to-contribute.md Installs project dependencies and starts the development server for the Auth0 Deploy CLI. The `npm install` command fetches all required packages, and `npm run dev` initiates a compiler that continuously observes source file changes, facilitating active development. ```shell npm install npm run dev ``` -------------------------------- ### Auth0 Deploy CLI Prompts Tenant YAML Configuration Example Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Provides a concrete YAML example of how to configure Auth0 prompts within the `tenant.yaml` file, demonstrating settings for identifier-first login, universal login experience, custom text translations for different prompts and languages, and referencing screen renderer configurations. ```yaml # Contents of ./tenant.yaml prompts: identifier_first: true universal_login_experience: classic customText: en: login: login: description: Login description in english buttonText: Button text mfa: mfa-detect-browser-capabilities: pickAuthenticatorText: 'Try another method' reloadButtonText: 'Reload' noJSErrorTitle: 'JavaScript Required' mfa-login-options: pageTitle: 'Log in to ${clientName}' authenticatorNamesSMS: 'SMS' screenRenderers: - signup-id: signup-id: ./prompts/screenRenderSettings/signup-id_signup-id.json - login-passwordless: login-passwordless-email-code: ./prompts/screenRenderSettings/login-passwordless_login-passwordless-email-code.json login-passwordless-sms-otp: ./prompts/screenRenderSettings/login-passwordless_login-passwordless-sms-otp.json ``` -------------------------------- ### Auth0 Deploy CLI Private Key JWT Configuration Example Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/authenticating-with-tenant.md This JSON snippet provides an example configuration for authenticating the Auth0 Deploy CLI using a private key JWT. It specifies the relative path to the private key file and the signing algorithm to be used for authentication. ```json { "AUTH0_CLIENT_SIGNING_KEY_PATH": "./private.pem", "AUTH0_CLIENT_SIGNING_ALGORITHM": "RSA256" } ``` -------------------------------- ### Run All Auth0 Deploy CLI Tests Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/how-to-contribute.md Executes the entire test suite for the Auth0 Deploy CLI project. This command ensures that all functionalities are working as expected before code contributions. ```shell npm run test ``` -------------------------------- ### Auth0 Deploy CLI `import` Command Usage Examples Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-cli.md Provides practical shell command examples for using the `a0deploy import` command. These examples demonstrate how to deploy configurations from local files to an Auth0 tenant, covering both YAML and directory formats, and how to control environment variable ingestion. ```shell # Deploying configuration for YAML formats a0deploy import -c=config.json --input_file=local/tenant.yaml ``` ```shell # Deploying configuration for directory format a0deploy import -c=config.json --input_file=local ``` ```shell # Deploying configuration with environment variables ignored a0deploy import -c=config.json --input_file=local/tenant.yaml --env=false ``` -------------------------------- ### Install Auth0 Deploy CLI Globally Source: https://github.com/auth0/auth0-deploy-cli/blob/master/README.md This command installs the Auth0 Deploy CLI tool globally on your system, allowing it to be run as a standalone command-line utility from any directory. It requires Node.js and npm to be installed. ```shell npm install -g auth0-deploy-cli ``` -------------------------------- ### Auth0 Deploy CLI Basic Configuration File Example Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/configuring-the-deploy-cli.md An example `config.json` file demonstrating basic Auth0 Deploy CLI configuration properties such as domain, client ID, and a flag to allow deletions. This method is suitable for non-sensitive configurations, but environment variables are recommended for credentials. ```json { "AUTH0_DOMAIN": "", "AUTH0_CLIENT_ID": "", "AUTH0_ALLOW_DELETE": false } ``` -------------------------------- ### Auth0 Deploy CLI Prompt Screen Renderer JSON Configuration Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Example JSON content for a `promptName_screenName.json` file, detailing rendering settings for a specific prompt and screen. It includes properties like rendering mode, context configuration, head tags, and client-specific filters. ```json { "prompt": "signup-id", "screen": "signup-id", "rendering_mode": "advanced", "context_configuration": ["branding.settings", "branding.themes.default"], "default_head_tags_disabled": false, "head_tags": [ { "tag": "script", "attributes": { "src": "URL_TO_YOUR_ASSET", "async": true, "defer": true, "integrity": ["ASSET_SHA"] } } ], "filters": { "match_type": "includes_any", "clients": [ { "id": "SeunfRe6p8EXxV6I0g9kMYdT1DxpfC38", "metadata": { "key1": "value1" } } ] }, "use_page_template": false } ``` -------------------------------- ### Auth0 Deploy CLI `export` Command Usage Examples Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-cli.md Provides practical shell command examples for using the `a0deploy export` command. These examples demonstrate how to fetch Auth0 tenant configurations in different formats (YAML, directory/JSON) and how to include asset IDs in the export. ```shell # Fetching Auth0 tenant configuration in the YAML format a0deploy export -c=config.json --format=yaml --output_folder=local ``` ```shell # Fetching Auth0 tenant configuration in directory (JSON) format a0deploy export -c=config.json --format=directory --output_folder=local ``` ```shell # Fetching Auth0 tenant configurations with IDs of all assets a0deploy export -c=config.json --format=yaml --output_folder=local --export_ids=true ``` -------------------------------- ### Auth0 Branding Configuration (YAML & JSON) Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Demonstrates how to define Auth0 tenant branding settings, including colors, favicon, font, and logo URLs, using both YAML and JSON configuration files for the Auth0 Deploy CLI. The YAML example also shows how to reference a universal login template. ```yaml branding: colors: page_background: '#FF4F40' primary: '#2A2E35' favicon_url: https://example.com/favicon.png font: url: https://example.com/font.woff logo_url: https://example.com/logo.png templates: - template: universal_login body: ./branding_templates/universal_login.html ``` ```json { "colors": { "page_background": "#FF4F40", "primary": "#2A2E35" }, "favicon_url": "https://example.com/favicon.png", "font": { "url": "https://example.com/font.woff" }, "logo_url": "https://example.com/logo.png" } ``` -------------------------------- ### Install Auth0 Deploy CLI Project Dependencies Source: https://github.com/auth0/auth0-deploy-cli/blob/master/CONTRIBUTING.md Command to install all necessary project dependencies for the Auth0 Deploy CLI using npm's clean install command, ensuring a consistent environment. ```bash npm ci ``` -------------------------------- ### Auth0 Deploy CLI Local Testing Commands Source: https://github.com/auth0/auth0-deploy-cli/blob/master/CONTRIBUTING.md Commands to build the project and test the Auth0 Deploy CLI locally, including running the CLI with help flags for various commands and examples for exporting and importing tenant configurations. ```bash npm run build ``` ```bash node lib/index.js --help ``` ```bash node lib/index.js export --help ``` ```bash node lib/index.js import --help ``` ```bash node lib/index.js export -c config.json -f yaml -o ./local-export/ ``` ```bash node lib/index.js import -c config.json -i ./local-export/tenant.yaml ``` -------------------------------- ### Auth0 Universal Login HTML Template Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Provides an example of a custom HTML template for the Auth0 Universal Login page. This template includes placeholders for Auth0-specific elements (`auth0:head` and `auth0:widget`) to integrate with the Auth0 login flow. ```html {%- auth0:head -%} {%- auth0:widget -%}
page teamplate
``` -------------------------------- ### Auth0 Deploy CLI: Example Configuration File (config.json) Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/yaml/README.md This JSON configuration file defines parameters for the Auth0 Deploy CLI, including the Auth0 domain, client ID/secret for the deploy client, and various options for allowing deletions, keyword replacements, and property inclusions/exclusions. It is essential for authenticating and controlling the deployment process. ```json { "AUTH0_DOMAIN": "", "AUTH0_CLIENT_SECRET": "", "AUTH0_CLIENT_ID": "", "AUTH0_ALLOW_DELETE": false, "AUTH0_KEYWORD_REPLACE_MAPPINGS": { "YOUR_ARRAY_KEY": [ "http://localhost:8080", "https://somedomain.com" ], "YOUR_STRING_KEY": "some environment specific string" }, "INCLUDED_PROPS": { "clients": [ "client_secret" ] }, "EXCLUDED_PROPS": { "connections": [ "options.client_secret" ] }, "AUTH0_EXCLUDED_RULES": [ "auth0-account-link-extension" ], "AUTH0_EXCLUDED_CLIENTS": [ "auth0-account-link" ], "AUTH0_EXCLUDED_RESOURCE_SERVERS": [ "SSO Dashboard API" ], "AUTH0_EXCLUDED_DEFAULTS": ["emailProvider"] } ``` -------------------------------- ### Auth0 Deploy CLI Environment Variable Usage Examples Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/configuring-the-deploy-cli.md Demonstrates how to configure the Auth0 Deploy CLI using environment variables for sensitive credentials and complex data structures. Includes examples for importing configurations, disabling environment variable ingestion, and passing serialized JSON values for non-primitive settings. ```shell # Deploying configuration for YAML formats without a config.json file export AUTH0_DOMAIN= export AUTH0_CLIENT_ID= export AUTH0_CLIENT_SECRET= a0deploy import --input_file=local/tenant.yaml # Disable environment variable ingestion a0deploy export -c=config.json --format=yaml --output_folder=local --env=false # Non-primitive configuration values export AUTH0_EXCLUDED='["actions","organizations"]' export AUTH0_KEYWORD_REPLACE_MAPPINGS='{"ENVIRONMENT":"dev"}' a0deploy export -c=config.json --format=yaml --output_folder=local ``` -------------------------------- ### Auth0 Deploy CLI Configuration File Structure Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/directory/README.md This JSON snippet provides an example of the `config.json` file used by the Auth0 Deploy CLI. It defines essential parameters such as `AUTH0_DOMAIN`, `AUTH0_CLIENT_SECRET`, and `AUTH0_CLIENT_ID` for authentication. It also includes options for keyword replacement, allowing or disallowing deletions, and specifying properties or entities to include or exclude during deployment operations. ```json { "AUTH0_DOMAIN": "", "AUTH0_CLIENT_SECRET": "", "AUTH0_CLIENT_ID": "", "AUTH0_KEYWORD_REPLACE_MAPPINGS": { "YOUR_ARRAY_KEY": [ "http://localhost:8080", "https://somedomain.com" ], "YOUR_STRING_KEY": "some environment specific string" }, "AUTH0_ALLOW_DELETE": false, "INCLUDED_PROPS": { "clients": [ "client_secret" ] }, "EXCLUDED_PROPS": { "connections": [ "options.client_secret" ] }, "AUTH0_EXCLUDED_RULES": [ "auth0-account-link-extension" ], "AUTH0_EXCLUDED_CLIENTS": [ "auth0-account-link" ], "AUTH0_EXCLUDED_RESOURCE_SERVERS": [ "SSO Dashboard API" ], "AUTH0_EXCLUDED_DEFAULTS": ["emailProvider"] } ``` -------------------------------- ### Auth0 Deploy CLI: Keyword Replacement in Tenant Configuration Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/yaml/README.md This example demonstrates how to use keyword replacement within Auth0 tenant configuration files (e.g., `Client.json`) to inject environment-specific values. It shows two types of replacements: `##key##` for literal replacement and `@@key@@` for JSON stringified replacement, allowing dynamic configuration based on environment variables or `config.json` mappings. ```json { ... "callbacks": [ "##ENVIRONMENT_URL##/auth/callback" ], "jwt_configuration": { "lifetime_in_seconds": @@JWT_TIMEOUT@@, "secret_encoded": true } ... } ``` -------------------------------- ### Apply Auth0 Configuration with Node.js `deploy` function Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-node-module.md This TypeScript example illustrates how to use the `deploy` function from `auth0-deploy-cli` to apply local Auth0 configurations to an Auth0 tenant. It requires specifying an input file (e.g., `tenant.yaml`) and Auth0 API credentials. ```ts import { deploy } from 'auth0-deploy-cli'; deploy({ input_file: './local/tenant.yaml', config: { AUTH0_DOMAIN: '', AUTH0_CLIENT_ID: '', AUTH0_CLIENT_SECRET: '', }, }) .then(() => { console.log('Auth0 configuration applied to tenant successful'); }) .catch((err) => { console.log('Error when applying configuration to Auth0 tenant:', err); }); ``` -------------------------------- ### Export Auth0 Configuration with Node.js `dump` function Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-node-module.md This TypeScript example demonstrates how to use the `dump` function from `auth0-deploy-cli` to fetch Auth0 tenant configurations and save them locally. It requires specifying an output folder, format, and Auth0 API credentials. ```ts import { dump } from 'auth0-deploy-cli'; dump({ output_folder: './local', format: 'yaml', config: { AUTH0_DOMAIN: '', AUTH0_CLIENT_ID: '', AUTH0_CLIENT_SECRET: '', }, }) .then(() => { console.log('Auth0 configuration export successful'); }) .catch((err) => { console.log('Error during Auth0 configuration export:', err); }); ``` -------------------------------- ### Auth0 Deploy CLI Development Environment Configuration Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/multi-environment-workflow.md Example JSON configuration file for a development environment, demonstrating how to specify environment-specific values like domain, client ID, deletion allowance, and keyword replacement mappings for dynamic values such as allowed origins. This configuration is used by the Auth0 Deploy CLI. ```JSON { "AUTH0_DOMAIN": "travel0-dev.us.auth0.com", "AUTH0_CLIENT_ID": "PdwQpGy62sHcsV6ufZNEVrV4GDlDhm74", "AUTH0_ALLOW_DELETE": true, "AUTH0_KEYWORD_REPLACE_MAPPINGS": { "ENV": "dev", "ALLOWED_ORIGINS": ["http://localhost:3000", "http://dev.travel0.com"] } } ``` -------------------------------- ### Auth0 Phone Provider Configuration (YAML & JSON) Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Examples for configuring Auth0 phone providers, specifically Twilio, using both YAML and JSON formats for the Auth0 Deploy CLI. It shows how to define provider name, configuration details like SID and default sender, delivery methods, and how to use a placeholder for sensitive credentials like the auth token. ```yaml # Contents of ./tenant.yaml phoneProviders: - name: twilio configuration: sid: 'twilio_sid' default_from: '+1234567890' delivery_methods: - text - voice disabled: false credentials: auth_token: '##TWILIO_AUTH_TOKEN##' ``` ```json [ { "name": "twilio", "disabled": true, "configuration": { "sid": "twilio_sid", "default_from": "+1234567890", "delivery_methods": ["text", "voice"] }, "credentials": { "auth_token": "##TWILIO_AUTH_TOKEN##" } } ] ``` -------------------------------- ### Apply Keyword Replacement in Auth0 Deploy CLI YAML Configuration Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/keyword-replacement.md This example illustrates how to use keyword replacement within a `tenant.yaml` file. It shows two syntaxes: `##KEY##` for literal replacement (no quotes/braces added) and `@@KEY@@` for JSON-stringified replacement (quotes for strings, braces for arrays/objects). ```yaml tenant: friendly_name: '##ENVIRONMENT## tenant' allowed_logout_urls: '@@ALLOWED_LOGOUT_URLS@@' enabled_locales: - en clients: - name: Test App allowed_origins: '@@ALLOWED_ORIGINS@@' allowed_logout_urls: '@@ALLOWED_LOGOUT_URLS@@' ``` -------------------------------- ### Auth0 NetworkACL Configuration (YAML & JSON) Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Examples demonstrating how to configure Auth0 Tenant Network Access Control Lists (NetworkACLs) using both YAML and JSON formats for the Auth0 Deploy CLI. These rules control access based on criteria like geographical location or user agents, specifying actions such as allow or block. ```yaml # Contents of ./tenant.yaml networkACLs: - description: 'Allow Specific Countries' active: true priority: 2 rule: action: allow: true scope: 'authentication' match: geo_country_codes: ['US', 'CA'] - description: 'Redirect Specific User Agents' active: true priority: 3 rule: action: block: true scope: 'management' not_match: user_agents: ['BadBot/1.0'] ``` ```json { "description": "Allow Specific Countries", "active": true, "priority": 2, "rule": { "action": { "allow": true }, "scope": "authentication", "match": { "geo_country_codes": ["US", "CA"] } } } ``` ```json { "description": "Redirect Specific User Agents", "active": true, "priority": 3, "rule": { "action": { "block": true }, "scope": "management", "match": { "user_agents": ["BadBot/1.0"] } } } ``` -------------------------------- ### Auth0 Deploy CLI Excluding Resources in config.json Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/configuring-the-deploy-cli.md Example of how to exclude specific resource types from management within the `config.json` file using the `AUTH0_EXCLUDED` property. This is particularly useful for Free Tier tenants to exclude resources like `logStreams` and `customDomains` that require a paid plan. ```json "AUTH0_EXCLUDED": ["logStreams", "customDomains"] ``` ```json { "AUTH0_EXCLUDED": ["organizations", "connections", "hooks"] } ``` -------------------------------- ### Configure Mappings for Array Concatenation in Auth0 Deploy CLI Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/keyword-replacement.md This `config.json` example shows how to prepare a string within `AUTH0_KEYWORD_REPLACE_MAPPINGS` for array concatenation. By escaping double quotes, the string can contain comma-separated values that, when injected, effectively extend an existing array in the target configuration. ```json { "AUTH0_KEYWORD_REPLACE_MAPPINGS": { "GLOBAL_WEB_ORIGINS": "\"http://local.me:8080\", \"http://localhost\", \"http://localhost:3000\"" } } ``` -------------------------------- ### Auth0 Management API Scopes for Deploy CLI Source: https://github.com/auth0/auth0-deploy-cli/wiki/Migrating This entry details the Auth0 Management API scopes required by the Auth0 Deploy CLI for various versions, including support for Actions, Organizations, and Hooks. These permissions are essential for the CLI to manage Auth0 resources effectively. ```APIDOC Required Scopes for v5 to v7 Upgrade: - create:actions - read:actions - update:actions - delete:actions - read:organizations - update:organizations - create:organizations - delete:organizations - create:organization_connections - read:organization_connections - update:organization_connections - delete:organization_connections Required Scopes for v5.4.0 / v6.0.0 (Actions): - create:actions - read:actions - update:actions - delete:actions Required Scopes for v3 to v4 (Hooks): - create:hooks - read:hooks - update:hooks - delete:hooks ``` -------------------------------- ### YAML Example of Empty Auth0 Resource Configuration Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/excluding-from-management.md This YAML snippet demonstrates how to explicitly define empty configurations for various Auth0 resources within the Deploy CLI. It illustrates that `connections: []` will empty connections, `tenant: {}` is effectively a no-op as the tenant cannot be deleted, and `emailProvider: {}` will trigger the deletion of the email provider. ```yaml connections: [] # Empty connections tenant: {} # Effectively a no-op, cannot delete tenant emailProvider: {} # Will delete email provider ``` -------------------------------- ### Run Specific Auth0 Deploy CLI Tests with ts-mocha Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/how-to-contribute.md Executes a single test file or a specific test within a file using `ts-mocha`. This command is useful for targeted testing during development, allowing contributors to focus on specific changes without running the entire test suite. The `--timeout` flag sets the maximum execution time, and `-p tsconfig.json` specifies the TypeScript configuration. ```shell npx ts-mocha --timeout=7500 -p tsconfig.json -g= ``` ```shell # Runs all tests within a file npx ts-mocha --timeout=7500 -p tsconfig.json test/tools/auth0/handlers/actions.tests.js ``` ```shell # Runs a single test within a file npx ts-mocha --timeout=7500 -p tsconfig.json \ test/tools/auth0/handlers/actions.tests.js \ -g="should create action" ``` -------------------------------- ### Auth0 Deploy CLI: Include Only Specific Resource Types using AUTH0_INCLUDED_ONLY Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/excluding-from-management.md This example illustrates the use of the `AUTH0_INCLUDED_ONLY` property to specify which resource types the Auth0 Deploy CLI should exclusively manage. All resource types not listed in this array will be excluded. This approach is beneficial when your workflow focuses on a very specific subset of resources, improving performance and reducing operational overhead. ```json { "AUTH0_DOMAIN": "example-site.us.auth0.com", "AUTH0_CLIENT_ID": "", "AUTH0_INCLUDED_ONLY": ["actions", "clients", "connections"] } ``` -------------------------------- ### Auth0 Deploy CLI Hook Property Name Changes (v4.dev to v4) Source: https://github.com/auth0/auth0-deploy-cli/wiki/Migrating This snippet documents the changes in property names for hooks within the Auth0 Deploy CLI when upgrading from v4.dev to v4. Developers should update their configurations to use the new property names for 'code' and 'active' hook attributes. ```APIDOC Old property name | New property name ------------------|------------------- hook.code | hook.script hook.active | hook.enabled ``` -------------------------------- ### Disable Auth0 Email Provider via Configuration Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/v8_MIGRATION_GUIDE.md This YAML snippet illustrates how to disable the email provider within an Auth0 configuration file. Setting the 'enabled' property to 'false' effectively disables the email provider, as direct deletion is not supported in Auth0 4.x. This configuration ensures the email provider is inactive without attempting an unsupported delete operation. ```yaml emailProvider: # other properties enabled: false ``` -------------------------------- ### Auth0 Deploy CLI: Example of Resource Omission in Configuration Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/excluding-from-management.md This YAML snippet illustrates the concept of 'omission' in Auth0 Deploy CLI configurations. When a resource configuration (like 'clients' or 'connections') is entirely absent from the configuration file, it is considered 'omitted'. Omitted configurations will be skipped during import operations and will not alter the remote tenant state. This differs from explicit exclusion, which forcefully ignores configurations. ```yaml roles: # roles configuration is not omitted - name: Admin description: Can read and write things permissions: [] - name: Reader description: Can only read things permissions: [] # The omission of all other configurations means they'll be skipped over ``` -------------------------------- ### Auth0 Deploy CLI: Exclude Resource Types using AUTH0_EXCLUDED Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/excluding-from-management.md This configuration example demonstrates how to use the `AUTH0_EXCLUDED` property to prevent specific resource types from being managed by the Auth0 Deploy CLI. The listed resource types (clients, connections, databases, organizations) will be ignored during both export from Auth0 and import to Auth0. This is useful for large tenants or when certain resource types are managed outside the CLI. ```json { "AUTH0_DOMAIN": "example-site.us.auth0.com", "AUTH0_CLIENT_ID": "", "AUTH0_EXCLUDED": ["clients", "connections", "databases", "organizations"] } ``` -------------------------------- ### Auth0 Deploy CLI `deploy` Function API Reference Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-node-module.md Detailed API documentation for the `deploy` function, which applies local Auth0 configurations to an Auth0 tenant. It outlines all available parameters, their types, and descriptions. ```APIDOC deploy(options: object): Promise - Applies configurations from local machine to Auth0 tenant. - Parameters: - input_file: Path. Specifies the location of the resource configuration files. For YAML formats, this will point to the tenant.yaml file. For directory formats, this will point to the resource configuration directory. - config: Object. Configures behavior of utility. Refer to the list of [all configurable properties](./configuring-the-deploy-cli.md). - config_file: Path. Specifies the user-defined configuration file (config.json). Refer to the list of [all configurable properties](./configuring-the-deploy-cli.md). - export_ids: Boolean. When enabled, will export the identifier fields for each resource. Default: `false`. - env: Boolean. Indicates if the tool should ingest environment variables or not. Default: `false`. - proxy_url: String. A URL for proxying requests. Only set this if you are behind a proxy. - Returns: Promise ``` -------------------------------- ### Auth0 Deploy CLI `dump` Function API Reference Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-node-module.md Detailed API documentation for the `dump` function, which fetches Auth0 tenant configurations to the local machine. It outlines all available parameters, their types, and descriptions. ```APIDOC dump(options: object): Promise - Fetches configurations from Auth0 tenant to the local machine. - Parameters: - output_folder: Path. Specifies the target directory for configuration files to be written to. - format: String. Options: `yaml` or `directory`. Determines the file format of the exported resource configuration files. See: [Available Resource Configuration Formats](available-resource-config-formats). - config: Object. Configures behavior of utility. Refer to the list of [all configurable properties](./configuring-the-deploy-cli.md). - config_file: Path. Specifies the user-defined configuration file (config.json). Refer to the list of [all configurable properties](./configuring-the-deploy-cli.md). - export_ids: Boolean. When enabled, will export the identifier fields for each resource. Default: false. - env: Boolean. Indicates if the tool should ingest environment variables or not. Default: `false`. - proxy_url: String. A URL for proxying requests. Only set this if you are behind a proxy. - Returns: Promise ``` -------------------------------- ### Auth0 Deploy CLI Commands Reference Source: https://github.com/auth0/auth0-deploy-cli/blob/master/README.md Comprehensive documentation for the Auth0 Deploy CLI commands, including `export` for retrieving tenant configurations and `import` for applying local configurations to an Auth0 tenant. These commands facilitate automated management of Auth0 tenant settings. ```APIDOC a0deploy export [options] - Exports Auth0 tenant configuration to local files. - Parameters: --format=: Output format for the configuration files (e.g., yaml, json). Default: yaml. --output_folder=: Directory where the exported configuration files will be saved. Default: current directory. - Usage Example: a0deploy export --format=yaml --output_folder=local a0deploy import [options] - Imports Auth0 tenant configuration from local files to the Auth0 tenant. - Parameters: --config_file=: Path to the Deploy CLI configuration file (e.g., config.json). --input_file=: Path to the input configuration file or directory (e.g., local/tenant.yaml). - Usage Example: a0deploy import --config_file=config.json --input_file local/tenant.yaml ``` -------------------------------- ### Fork and Clone Auth0 Deploy CLI Repository Source: https://github.com/auth0/auth0-deploy-cli/blob/master/CONTRIBUTING.md Instructions for setting up the local development environment by forking the Auth0 Deploy CLI repository, cloning it, and adding the upstream remote to synchronize with the main project. ```bash git clone https://github.com/YOUR_USERNAME/auth0-deploy-cli.git cd auth0-deploy-cli ``` ```bash git remote add upstream https://github.com/auth0/auth0-deploy-cli.git ``` -------------------------------- ### Auth0 Deploy CLI Prompts YAML Folder Structure Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Illustrates the recommended folder structure for managing Auth0 prompts configurations when using the Deploy CLI in YAML mode, including the location for screen renderer settings. ```yaml Folder structure when in YAML mode. ./prompts/ /screenRenderSettings /signup-id_signup-id.json /login-id_login-id.json /login-passwordless_login-passwordless-email-code.json /login-passwordless_login-passwordless-sms-otp.json /login-password_login-password.json /signup-password_signup-password.json ./tenant.yaml ``` -------------------------------- ### Import Auth0 Tenant Configuration from Directory Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/directory/README.md This command illustrates how to import an Auth0 tenant configuration from a local directory into an Auth0 tenant. It uses a configuration file and specifies the current directory as the input source. This is typically run after preparing the configuration files in the specified directory. ```bash a0deploy import -c config.json -i . ``` -------------------------------- ### Import Auth0 Tenant Configuration from Local YAML Source: https://github.com/auth0/auth0-deploy-cli/blob/master/README.md This command imports Auth0 tenant configuration from a local YAML file to the Auth0 tenant. It uses a specified configuration file for CLI settings and points to the `tenant.yaml` file within the `local` directory as the input source. This pushes local changes to the Auth0 tenant, applying the configuration. ```shell a0deploy import --config_file=config.json --input_file local/tenant.yaml ``` -------------------------------- ### Configure Auth0 Database Custom Scripts with YAML Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Demonstrates how to define custom database scripts (e.g., change password, create user) within a `tenant.yaml` file, referencing external JavaScript files for implementation. This approach centralizes database connection configurations. ```yaml databases: - name: Username-Password-Authentication # ... options: # ... customScripts: change_password: ./databases/Username-Password-Authentication/change_password.js create: ./databases/Username-Password-Authentication/create.js delete: ./databases/Username-Password-Authentication/delete.js get_user: ./databases/Username-Password-Authentication/get_user.js login: ./databases/Username-Password-Authentication/login.js verify: ./databases/Username-Password-Authentication/verify.js ``` -------------------------------- ### Auth0 Deploy CLI Prompts Configuration Hierarchy Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Defines the YAML structure for configuring Auth0 prompts, including custom text translations and screen renderer settings. It shows the nested hierarchy for language codes, prompt IDs, screen IDs, and text IDs, as well as how screen renderers are referenced. ```yaml prompts: customText: : # two character language code : # prompt ID : # prompt screen ID : 'Some text' screenRenderers: - : : ./prompts/screenRenderSettings/promptName_screenName.json #Add the renderer configs for a given prompt & a given screen ``` -------------------------------- ### Configure Auth0 Universal Login Pages with JSON (Directory Mode) Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Demonstrates how to configure individual Universal Login pages using separate JSON files (e.g., `login.json`, `error_page.json`) in directory mode. Each JSON file specifies properties like enablement, name, and the path to its corresponding HTML content. ```json { "name": "login", "enabled": false, "html": "./login.html" } ``` ```json { "html": "./error_page.html", "show_log_link": false, "url": "https://mycompany.org/error", "name": "error_page" } ``` ```json { "enabled": true, "html": "./guardian_multifactor.html", "name": "guardian_multifactor" } ``` ```json { "enabled": true, "html": "./password_reset.html", "name": "password_reset" } ``` -------------------------------- ### Auth0 Deploy CLI: Keyword Replacement Mappings for Dev and Prod Environments Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/yaml/README.md These JSON snippets illustrate how `AUTH0_KEYWORD_REPLACE_MAPPINGS` in `config.json` can be used to define environment-specific values for keyword replacement. The 'Dev Config' provides values suitable for a development environment, while the 'Prod Config' provides values for a production environment, enabling seamless deployment of the same tenant configuration across different stages. ```json "AUTH0_KEYWORD_REPLACE_MAPPINGS": { "ENVIRONMENT_URL": "http://dev.fabrikam.com", "JWT_TIMEOUT": 120, ... } ``` ```json "AUTH0_KEYWORD_REPLACE_MAPPINGS": { "ENVIRONMENT_URL": "http://fabrikam.com", "JWT_TIMEOUT": 3600, ... } ``` -------------------------------- ### Auth0 Deploy CLI Prompts Directory Mode Folder Structure Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Shows the folder structure for Auth0 prompts configurations when the Deploy CLI is used in directory mode, including separate files for custom text, prompts, and screen renderer settings. ```yaml Folder structure when in directory mode. ./prompts/ /screenRenderSettings /signup-id_signup-id.json /login-id_login-id.json /login-passwordless_login-passwordless-email-code.json /login-passwordless_login-passwordless-sms-otp.json /login-password_login-password.json /signup-password_signup-password.json /custom-text.json /prompts.json ``` -------------------------------- ### Configure Auth0 Email Templates with YAML Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Shows how to define various email templates (e.g., verify email, welcome email) within `tenant.yaml`. This configuration specifies properties like subject, sender, syntax, and links to external HTML body files for the email content. ```yaml emailTemplates: - template: 'verify_email' enabled: true syntax: 'liquid' from: 'test@email.com' subject: 'something' body: 'emailTemplates/change_email.html' - template: 'welcome_email' enabled: true syntax: 'liquid' from: 'test@email.com' subject: 'something' body: 'emailTemplates/change_email.html' - template: 'password_reset' enabled: true syntax: 'liquid' from: 'test@email.com' subject: 'something' body: 'emailTemplates/change_email.html' - template: 'reset_email_by_code' enabled: true syntax: 'liquid' from: 'test@email.com' subject: 'something' body: 'emailTemplates/change_email.html' ``` -------------------------------- ### Auth0 Deploy CLI `import` Command Reference Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-cli.md Documents the `import` command of the Auth0 Deploy CLI, which is used to apply configurations from a local machine to an Auth0 tenant. It details command-line options for specifying input files, configuration files, and managing environment variables. ```APIDOC a0deploy import Description: Applies configurations from local machine to Auth0 tenant. Options: --input_file, -i: Path. Specifies the location of the resource configuration files. For YAML formats, this points to `tenant.yaml`; for directory formats, this points to the resource configuration directory. --config_file, -c: Path. Specifies the user-defined configuration file (`config.json`). --env: Boolean. Indicates if the tool should ingest environment variables or not. Default: `true`. --proxy_url, -p: A url for proxying requests. Only set this if you are behind a proxy. --debug: Boolean. Enables more verbose error logging; useful during troubleshooting. Default: `false`. --experimental_ea: Boolean. When enabled, gain early access Auth0 resources support and experimental features. Default: `false`. ``` -------------------------------- ### Configure Auth0 Universal Login Pages with YAML Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Illustrates how to define custom HTML pages for Universal Login (error, login, MFA, password reset) within `tenant.yaml`. This configuration links to external HTML files, allowing for complete customization of the login experience. ```yaml pages: - name: error_page html: ./pages/error_page.html show_log_link: false url: https://mycompany.org/error - name: guardian_multifactor enabled: true html: ./pages/guardian_multifactor.html - name: login enabled: false html: ./pages/login.html - name: password_reset enabled: true html: ./pages/password_reset.html ``` -------------------------------- ### Configure Auth0 Email Templates with JSON (Directory Mode) Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Illustrates how to configure individual email templates using separate JSON files (e.g., `welcome_email.json`, `reset_email.json`) in directory mode. Each JSON file defines the template's name, enablement status, and the path to its HTML content. ```json { "name": "welcome_email", "enabled": true, "html": "./welcome_email.html" } ``` ```json { "name": "reset_email", "enabled": true, "html": "./reset_email.html" } ``` ```json { "name": "reset_email_by_code", "enabled": true, "html": "./reset_email_by_code.html" } ``` -------------------------------- ### Configure Auth0 Database Custom Scripts with JSON (Directory Mode) Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Shows how to configure custom database scripts for a specific database connection using a `database.json` file in directory mode. This method allows for granular configuration of each database connection, referencing local JavaScript files for custom logic. ```json { "options": { "customScripts": { "change_password": "./change_password.js", "create": "./create.js", "delete": "./delete.js", "get_user": "./get_user.js", "login": "./login.js", "verify": "./verify.js" } } } ``` -------------------------------- ### Auth0 Deploy CLI Directory Structure Specification Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/directory/README.md This section outlines the expected directory and file structure for managing Auth0 tenant configurations using the Auth0 Deploy CLI. It specifies where different Auth0 entities like clients, connections, databases, emails, pages, resource servers, guardian settings, actions, and triggers should reside within the repository. This structure is crucial for the tool to correctly import and export configurations. ```APIDOC repository => clients client1.json client2.json connections connection1.json database-connections connection1 database.json create.js delete.js get_user.js login.js verify.js emails provider.json verify_email.json verify_email.html welcome_email.json welcome_email.html grants grant1.json pages login.html login.json password_reset.html password_reset.json resource-servers resource_server1.json resource_server2.json guardian factors sms.json email.json otp.json push-notification.json provider sms-twilio.json templates sms.json phoneFactorMessageTypes.json phoneFactorSelectedProvider.json policies.json actions action1 code.js current_version.js action1.json triggers triggers.json ``` -------------------------------- ### Export Auth0 Tenant Configuration to Directory Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/directory/README.md This command demonstrates how to export the current Auth0 tenant configuration into a specified directory using the `a0deploy` CLI tool. It requires a configuration file and an output path. The `AUTH0_EXPORT_IDENTIFIERS` option is noted as a way to include identifiers, which might affect subsequent imports. ```bash a0deploy export -c config.json -f directory -o path/to/export ``` -------------------------------- ### Auth0 Deploy CLI: Import Tenant Configuration from YAML Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/yaml/README.md This command imports an Auth0 tenant configuration from a specified YAML file. It uses a configuration file (`config.json`) and the input YAML file (`tenant.yaml`) to apply the configuration to the Auth0 tenant. ```bash a0deploy import -c config.json -i tenant.yaml ``` -------------------------------- ### Auth0 Deploy CLI Versioning Commands Source: https://github.com/auth0/auth0-deploy-cli/blob/master/CONTRIBUTING.md API documentation for `npm version` commands used to manage the versioning of the Auth0 Deploy CLI project, including options for production and beta releases without creating Git tags. ```APIDOC npm version patch --no-git-tag-version - Description: Increments the patch version of the package. - Parameters: - patch: Specifies to increment the patch version (e.g., 1.0.0 -> 1.0.1). - --no-git-tag-version: Prevents npm from creating a Git tag for the new version. - Usage: Used for production releases where Git tagging is handled separately or not desired by npm. npm version prerelease --preid beta --no-git-tag-version - Description: Increments the prerelease version of the package with a specified pre-release identifier. - Parameters: - prerelease: Specifies to increment the prerelease version (e.g., 1.0.0 -> 1.0.1-0). - --preid beta: Sets the prerelease identifier to 'beta' (e.g., 1.0.1-beta.0). - --no-git-tag-version: Prevents npm from creating a Git tag for the new version. - Usage: Used for beta releases or other pre-release versions, allowing for distinct versioning before a stable release. ``` -------------------------------- ### Auth0 Deploy CLI `export` Command Reference Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/using-as-cli.md Documents the `export` command of the Auth0 Deploy CLI, which is used to fetch Auth0 tenant configurations to a local machine. It details various command-line options for controlling output format, specifying configuration files, handling identifiers, and managing environment variables. ```APIDOC a0deploy export Description: Fetches configurations from Auth0 tenant to the local machine. Options: --output_folder, -o: Path. Specifies the target directory for configuration files to be written to. --config_file, -c: Path. Specifies the user-defined configuration file (`config.json`). --format, -f: Options: yaml or directory. Determines the file format of the exported resource configuration files. --export_ids, -e: Boolean. When enabled, will export the identifier fields for each resource. Default: `false`. --env: Boolean. Indicates if the tool should ingest environment variables or not. Default: `true`. --debug: Boolean. Enables more verbose error logging; useful during troubleshooting. Default: `false`. --proxy_url, -p: A url for proxying requests. Only set this if you are behind a proxy. --experimental_ea: Boolean. When enabled, gain early access Auth0 resources support and experimental features. Default: `false`. ``` -------------------------------- ### Auth0 Client Configuration with Keyword Mappings Source: https://github.com/auth0/auth0-deploy-cli/blob/master/examples/directory/README.md This JSON snippet demonstrates how to embed environment-specific values, such as callback URLs and JWT lifetimes, into an Auth0 client configuration using `##key##` for string interpolation and `@@key@@` for literal value injection. This allows for dynamic configuration based on the deployment environment. ```json { ... "callbacks": [ "##ENVIRONMENT_URL##/auth/callback" ], "jwt_configuration": { "lifetime_in_seconds": @@JWT_TIMEOUT@@, "secret_encoded": true } ... } ``` -------------------------------- ### Auth0 Deploy CLI Database Connections YAML Folder Structure Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/resource-specific-documentation.md Illustrates the folder structure for managing Auth0 database connection custom scripts when using the Deploy CLI in YAML mode, showing the location for various JavaScript files like `change_password.js`, `create.js`, etc. ```yaml Folder structure when in YAML mode. ./databases/ /Username-Password-Authentication /change_password.js /create.js /delete.js /get_user.js /login.js /verify.js ./tenant.yaml ``` -------------------------------- ### Auth0 Deploy CLI Configuration Properties Reference Source: https://github.com/auth0/auth0-deploy-cli/blob/master/docs/configuring-the-deploy-cli.md Comprehensive reference for all available configuration properties used by the Auth0 Deploy CLI, detailing their types, purposes, and specific constraints or usage notes. These properties can be set via `config.json` or environment variables. ```APIDOC AUTH0_DOMAIN Type: String Description: The domain of the target Auth0 tenant. AUTH0_CLIENT_ID Type: String Description: The ID of the designated Auth0 application used to make API requests. AUTH0_CLIENT_SECRET Type: String Description: The secret of the designated Auth0 application used to make API requests. AUTH0_ACCESS_TOKEN Type: String Description: Short-lived access token for Management API from designated Auth0 application. Can be used in replacement to client ID and client secret combination. AUTH0_CLIENT_SIGNING_KEY_PATH Type: String Description: The path to the private key used by the client when facilitating Private Key JWT authentication. Path relative to the working directory. Also note `AUTH0_CLIENT_SIGNING_ALGORITHM` for specifying signing algorithm. AUTH0_CLIENT_SIGNING_ALGORITHM Type: String Description: Specifies the JWT signing algorithms used by the client when facilitating Private Key JWT authentication. Only used in combination with `AUTH0_CLIENT_SIGNING_KEY_PATH`. Accepted values: `RS256`, `RS384`, `PS256`. AUTH0_ALLOW_DELETE Type: Boolean Description: When enabled, will allow the tool to delete resources. Default: `false`. AUTH0_EXCLUDED Type: Array of strings Description: Excludes entire resource types from being managed, bi-directionally. Cannot be used simultaneously with `AUTH0_INCLUDED_ONLY`. Possible values: `actions`, `attackProtection`, `branding`, `clientGrants`, `clients`, `connections`, `customDomains`, `databases`, `emailProvider`, `phoneProviders`, `emailTemplates`, `guardianFactorProviders`, `guardianFactorTemplates`, `guardianFactors`, `guardianPhoneFactorMessageTypes`, `guardianPhoneFactorSelectedProvider`, `guardianPolicies`, `logStreams`, `migrations`, `organizations`, `pages`, `prompts`, `resourceServers`, `roles`, `tenant`, `triggers`, `selfServiceProfiles`. ``` -------------------------------- ### Export Auth0 Tenant Configuration to Local YAML Source: https://github.com/auth0/auth0-deploy-cli/blob/master/README.md This command exports the current Auth0 tenant configuration to local YAML files. It specifies the output format as YAML and the destination folder as 'local'. This is typically the first step in managing Auth0 configurations via the CLI, allowing for local inspection and modification. ```shell a0deploy export --format=yaml --output_folder=local ```