# Package and publish Metadata components

> Status: Beta

> Package a Metadata project into a version, publish it, and install it in a second sandbox with the Rippling CLI.

You can bundle the components in your project into a package, publish it, and install it in another company. Package the equipment request object and list view from [Create your first Metadata components](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/build-and-deploy), publish the package, and install it in a second sandbox. To package your own components, use your project in place of the example.

* * *

## What are packages and versions?

A **package** is a named set of components from your project. You release changes to a package as **versions**, such as `0.1.0`. Each version is a copy of your components as they were when you created it. Publishing a version makes it available to install. A published version is final, so to release later changes, create a new version with a higher number.

* * *

## Requirements

-   Get access to the [Developer Program](https://developer.rippling.com/documentation/rippling-platform/developer-program/apply) closed beta.
-   Install the latest beta [Rippling CLI](https://developer.rippling.com/documentation/rippling-platform/rippling-cli/get-started). The `--force-publish` flag is available in the latest beta.
-   Open the `equipment-requests-demo` project from [Create your first Metadata components](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/build-and-deploy), or your own Rippling project. The project needs a `rippling.manifest.ts` and installed dependencies.
-   Use a [CLI context](https://developer.rippling.com/documentation/rippling-platform/rippling-cli/accounts-and-contexts) for your Developer account that has `packages.read-write` access. The commands below use `developer-account` as the context name. Replace it with yours.

* * *

## Create and publish the first version

From the project root, create the package and publish its first version:

```bash
rippling --context developer-account project package . \
  --name 'Equipment Requests Demo' \
  --key equipment_requests_demo \
  --type unmanaged \
  --force-publish \
  --json
```

| Flag | Value in this example | What it sets |
| --- | --- | --- |
| `--name` | `Equipment Requests Demo` | The package's display name. |
| `--key` | `equipment_requests_demo` | The package key, which is unique in your Developer account. It starts with a lowercase letter, contains only lowercase letters, digits, and underscores, and can't contain `rippling`. |
| `--type` | `unmanaged` | The package type. A package keeps the type you choose when you create it. |
| `--force-publish` |  | Publishes the version as soon as the CLI creates it. |

An unmanaged package lets the company that installs it edit the installed components. To deliver upgrades to existing installs, create a managed package instead.

The CLI creates the package in your Developer account and adds version `0.1.0` from your project. It also creates `package.manifest.ts`, which imports your manifest and stores the package details and version:

package.manifest.ts

```ts
import { definePackageManifest } from '@rippling/rippling-sdk';
import manifest from './rippling.manifest';

export default definePackageManifest({
  package: {
    "key": "equipment_requests_demo",
    "name": "Equipment Requests Demo",
    "type": "unmanaged",
    "description": "A package of custom Rippling components."
  },
  version: "0.1.0",
  manifest,
});
```

If a package with the key `equipment_requests_demo` already exists, the CLI adds the version to that package. To create a separate package, pass a different `--key`.

In the JSON response, confirm that `version_number` is `0.1.0` and `is_published` is `true`. Copy the value of `id`. This is the **version ID** that you use to install the version.

### Publish later instead

To hold a version back, omit `--force-publish`. The CLI creates the version as a draft that no one can install, and the response shows `is_published: false`. When you're ready, replace `YOUR_VERSION_ID` with the draft's `id` and publish it:

```bash
rippling --context developer-account api package-versions publish --version-id 'YOUR_VERSION_ID' --json
```

* * *

## Install the package in a second sandbox

Install the package in a different sandbox from the one you deployed to, so you can see the installation create the equipment request object. [Set up a sandbox](https://developer.rippling.com/documentation/rippling-platform/developer-program/sandboxes) or reuse an existing one. That guide shows how to create a sandbox and save it as a CLI context with `rippling sandbox use`. The commands below use `sandbox-package-test` as the context name. Replace it with yours.

Replace `YOUR_VERSION_ID` with the version ID you copied, then install the version:

```bash
VERSION_ID='YOUR_VERSION_ID'
rippling --context sandbox-package-test package install --version-id "$VERSION_ID" --json
```

The install response includes an `id`, which is the **tracker ID**. Replace `YOUR_TRACKER_ID` with that value, then check the installation status:

```bash
rippling --context sandbox-package-test package installation status \
  --tracker-id 'YOUR_TRACKER_ID' --json
```

Run the status command again until `status` is `COMPLETE`. If `status` is `FAILED` or `COMPLETE_WITH_WARNINGS`, read `error_message`. `COMPLETE_WITH_WARNINGS` means Rippling installed the components, but a later step failed, such as the post-install Function.

When `status` is `COMPLETE`, sign in to your Developer account in the Rippling UI. Navigate to **Developer > Developer Sandbox**, then click **Log in** next to the second sandbox. Find the **Equipment Request** object and the **All equipment requests** list view.

You now have version `0.1.0` of the `equipment_requests_demo` package, published in your Developer account. Installing it in the second sandbox created the equipment request object and list view there from the package.

* * *

## Release another version

To release a change, first make it in your project. For example, rename the list view in `custom-objects/equipment-request.ts`, or copy a change from Rippling with [rippling project pull](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/pull-changes). Then create and publish the next patch version:

```bash
rippling --context developer-account project package . --bump --force-publish --json
```

For the first patch after `0.1.0`, the CLI publishes version `0.1.1` and updates the version in `package.manifest.ts`. Version `0.1.0` stays as it was. Copy the `id` from the response to install the new version.

For a different version number, use `--bump minor`, `--bump major`, or `--version 1.0.0`. A version can be published only if its number is higher than the latest published version.

Without `--bump` or `--version`, the command targets the version saved in `package.manifest.ts`. If that version already exists, the CLI stops and changes nothing.

* * *

## Next steps

-   [Configure post-install settings](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/post-install) to run a Function after the package installs or choose the Custom App that opens.
-   [Create an App Shop listing](https://developer.rippling.com/documentation/rippling-platform/developer-program/build#create-an-app-shop-listing) for the published package.

* * *

## See also

-   [Get started with Metadata](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/get-started)
-   [Create your first Metadata components](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/build-and-deploy)
-   [Configure post-install settings](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/post-install)
-   [CLI package commands](https://developer.rippling.com/documentation/rippling-platform/rippling-cli/packages)
-   [Developer sandboxes](https://developer.rippling.com/documentation/rippling-platform/developer-program/sandboxes)

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/package-and-publish

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
