# Package Your Tableau Next App

After creating Tableau Next assets in your scratch org and adding them to a data kit, you're ready to package and deploy.

1. From the CLI, run the following command to create a beta Salesforce managed package that points to your data kit metadata folder:
   ```bash
   sf package create -n PACKAGE_NAME -t Managed -v DEVHUB_ALIAS -p PATH_TO_DATA_KIT
   ```
   Beta packages can only be installed in scratch orgs. See [`package create`](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_create_unified).

2. If your Data 360 app builds on the Data Cloud Single Source of Truth (SSOT) package, you must declare the SSOT package as a dependency in your `sfdx-project.json` file. Find the latest SSOT package ID on the [Salesforce Partner Community](https://partners.salesforce.com) site. For example, if your package includes a CRM data stream that maps to a standard data model object (DMO), include the SSOT package as a dependency.

   ```json
     {
           "versionName": "ver 0.1",
           "versionNumber": "0.1.0.NEXT",
           "path": "data-cloud-app",
           "default": false,
           "package": "PACKAGE_NAME",
           "versionDescription": "",
           "dependencies": [
               {
                   "package": "0123456789abcdef"
               }
           ]
     }
   ```

3. Creating the managed package produces a `0ho` ID. Copy that ID. Next, create a managed package version with the `0ho` ID.

4. Use the following command to create the package version:
   ```bash
   `sf package version create -v DEVHUB_ALIAS -k INSTALLATION_KEY -p 0ho_ID -w 45 -f config/project-scratch-def.json`
   ```
   See [`package create`](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_package_commands_unified.htm#cli_reference_package_create_unified).

5. To distribute the package, promote the package version to a released version. The released version can be installed in a production org. See [Release a Second-Generation Managed Package](https://developer.salesforce.com/docs/atlas.en-us.pkg2\_dev.meta/pkg2\_dev/sfdx_dev_dev2gp_create_pkg_ver_promote.htm).
