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.
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Log in to your DE org via the CLI. For org login web and other command details, see the CLI command reference guide.
  6. 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.
    git clone https://github.com/forcedotcom/sfdx-analytics.git
  7. See the README file in the repository for more information on the CRM Analytics Lightning Web Component example components.
  8. Deploy the CRM Analytics Lightning Web Component examples in the project from the command line with

    sf 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.

  9. Use and adapt the CRM Analytics LWC examples to create your own custom Lightning Web Component widgets for CRM Analytics dashboards.
  10. 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 component CLI command.

    The SFDX: Create Analytics Dashboard LWC command requires installation of the analyticsdx-vscode extension pack.

    Note