Setup Instructions
Use these instructions to set up your Salesforce org for development of Lightning Web Components and to use the CRM Analytics Lightning Web Component examples provided.
-
Create or use a Developer Edition (DE) org enabled for CRM Analytics. Sign up for a new CRM Analytics enabled DE org at developer.salesforce.com/promotions/orgs/analytics-de.
-
If you plan to publish any of your own Lightning Web Component work to App Exchange, enable your DE org as a dev hub. For more information about enabling dev hubs, see Enable Dev Hub Features in Your Org.
-
Create a Connected App, a record client key, and a secret. DO NOT use the JWT flow. For more information on Connected Apps, see Create a Connected App for Your Dev Hub Org.
-
Install the Salesforce CLI. For detailed instructions, see Install Salesforce CLI. Alternatively, you can install Visual Studio Code to perform steps 6–10. See Install Salesforce Extensions for Visual Studio.
-
Log in to your DE org via the CLI. For
org login weband other command details, see the CLI command reference guide. -
Clone the GitHub repository containing the CRM Analytics Lightning Web Component example components. This repository is structured as a Salesforce DX project for use with CLI commands.
1git clone https://github.com/forcedotcom/sfdx-analytics.git -
See the README file in the repository for more information on the CRM Analytics Lightning Web Component example components.
-
Deploy the CRM Analytics Lightning Web Component examples in the project from the command line with
1sf project deploy start --source-dir quick-start/main/default/lwc --target-org <USERNAME>or use the SFDX: Deploy Source to Org command in Visual Studio code.
-
Use and adapt the CRM Analytics LWC examples to create your own custom Lightning Web Component widgets for CRM Analytics dashboards.
-
Create your own component using the SFDX: Create Analytics Dashboard LWC command in Visual Studio Code or a standard Lightning Web Component with the
sf lightning generate componentCLI command.The SFDX: Create Analytics Dashboard LWC command requires installation of the
analyticsdx-vscodeextension pack.Note
See Also