<div align="center">
  <img src="https://prismatic.io/favicon-48x48.png" alt="Prismatic" />
  <h1>@prismatic-io/prism</h1>
</div>

**Prism** is [Prismatic's](https://prismatic.io/) CLI tool that allows you to build, deploy, and support integrations in Prismatic from the comfort of your command line.

## Using Prism

Prism requires Node.js 22.19.0 or newer and npm.
You can download both from the [NodeJS Website](https://nodejs.org/).
Prism works on MacOS, Linux, Windows and [WSL](https://docs.microsoft.com/en-us/windows/wsl/).

Once `node` and `npm` are installed, run this to install Prismatic's CLI tool:

```bash
$ npm install --global @prismatic-io/prism
```

This will install the `prism` command globally.
To log in, run:

```bash
$ prism login
```

You can then see your login information with:

```bash
$ prism me
Name: John Doe
Email: john.doe@example.com
Organization: Example Software Company
Organization ID: example-organization-id
Endpoint URL: https://app.prismatic.io
Authentication: Profile
Profile: default
```

### Component manifests in code-native integrations

New integrations start without component manifest scaffolding, so you can import callable
npm component packages directly without configuring a registry. If you also need manifests,
you can include support when creating the integration with
`prism integrations:init my-integration --include-manifests`, or add it later.

After installing the integration's dependencies, run these commands from its root directory
to add, list, or remove manifests:

```bash
prism integrations:manifests:add slack
prism integrations:manifests:list
prism integrations:manifests:remove slack
```

Adding your first manifest creates the component registry and connects it to the integration
and its Spectral TypeScript declarations. You can then use registered manifests alongside
npm component imports. If you prefer to manage registration yourself, pass `--no-register`
to generate only the manifest files.

Before removing a manifest, remove references to it from your code. When you remove the last
manifest, Prism also removes the empty registry and its integration and type declarations,
while preserving configuration typing and npm dependencies. If customized code prevents safe
cleanup, Prism explains what needs attention before removing files. These commands manage
local manifests; removing one does not unpublish the component from Prismatic.

### Profiles

Profiles let Prism stay logged in to multiple stacks or tenants at once. Each
profile keeps its credentials, stack, and tenant together. Commands use the
default profile unless another is selected.

Existing Prism configuration is used automatically and migrated to the profile
format the next time Prism updates it.

```bash
# Log in to a profile on another stack.
$ PRISMATIC_URL=https://my-stack.prismatic.io prism login --profile staging

# Select a profile for one command or the current shell.
$ prism integrations:list --profile staging
$ export PRISM_PROFILE=staging

# View, change, or delete saved profiles.
$ prism profiles:list
$ prism profiles:use staging
$ prism profiles:delete staging
```

Prism selects a profile from `--profile`, then `PRISM_PROFILE`, then the saved
default. Environment credentials take precedence over credentials stored in the
selected profile. When environment credentials are set, they use `PRISMATIC_URL`
and `PRISMATIC_TENANT_ID` instead of values from a profile. Login, logout, and
tenant switching still operate on the selected profile.

For help with Prism, please see our [Prism documentation page](https://prismatic.io/docs/cli/).
There, you will find information about the various subcommands you can run, troubleshooting tips, etc.

### Share components through npm

Package a component for reuse in code-native integrations:

```bash
$ prism components:init acme --npm-package @your-org/acme
$ cd acme
$ npm publish
```

Install the package in your integration and import it to use its actions and
connections. Prism publishes private component dependencies to Prismatic when
you import the integration. Your npm package's access settings are separate from
its visibility in Prismatic.

To share a package locally without a registry, use `npm pack`.

## What is Prismatic?

Prismatic is the leading embedded iPaaS, enabling B2B SaaS teams to ship product integrations faster and with less dev time. The only embedded iPaaS that empowers both developers and non-developers with tools for the complete integration lifecycle, Prismatic includes low-code and code-native building options, deployment and management tooling, and self-serve customer tools.

Prismatic's unparalleled versatility lets teams deliver any integration from simple to complex in one powerful platform. SaaS companies worldwide, from startups to Fortune 500s, trust Prismatic to help connect their products to the other products their customers use.

With Prismatic, you can:

- Build [integrations](https://prismatic.io/docs/integrations/) using our [intuitive low-code designer](https://prismatic.io/docs/integrations/low-code-integration-designer/) or [code-native](https://prismatic.io/docs/integrations/code-native/) approach in your preferred IDE
- Leverage pre-built [connectors](https://prismatic.io/docs/components/) for common integration tasks, or develop custom connectors using our TypeScript SDK
- Embed a native [integration marketplace](https://prismatic.io/docs/embed/) in your product for customer self-service
- Configure and deploy customer-specific integration instances with powerful configuration tools
- Support customers efficiently with comprehensive [logging, monitoring, and alerting](https://prismatic.io/docs/monitor-instances/)
- Run integrations in a secure, scalable infrastructure designed for B2B SaaS
- Customize the platform to fit your product, industry, and development workflows

## Who uses Prismatic?

Prismatic is built for B2B software companies that need to provide integrations to their customers. Whether you're a growing SaaS startup or an established enterprise, Prismatic's platform scales with your integration needs.

Our platform is particularly powerful for teams serving specialized vertical markets. We provide the flexibility and tools to build exactly the integrations your customers need, regardless of the systems you're connecting to or how unique your integration requirements may be.

## What kind of integrations can you build using Prismatic?

Prismatic supports integrations of any complexity - from simple data syncs to sophisticated, industry-specific solutions. Teams use it to build integrations between any type of system, whether modern SaaS or legacy with standard or custom protocols. Here are some example use cases:

- Connect your product with customers' ERPs, CRMs, and other business systems
- Process data from multiple sources with customer-specific transformation requirements
- Automate workflows with customizable triggers, actions, and schedules
- Handle complex authentication flows and data mapping scenarios

For information on the Prismatic platform, check out our [website](https://prismatic.io/) and [docs](https://prismatic.io/docs/).

## License

This repository is MIT licensed.
