# Composer Installation

> Install the Editor42 WYSIWYG HTML editor with Composer, from the editor42/editor42 package. MIT-licensed, no account and no API key.

Source: https://editor42.com/docs/install/composer  
Section: Installation > Integrations > Composer  
Every page of editor42.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://editor42.com/llms-full.txt

The `editor42/editor42` package is the editor's ready-to-use build, the same one you can [download](https://editor42.com/docs/install/self-hosted), for PHP projects that take their front-end libraries from Composer. There is no account and no key of any kind.

## Install

```sh
composer require editor42/editor42
```

## Basic Setup

The files land in `vendor/editor42/editor42/`. Serve that folder, or copy it into your public directory, and load the editor from it:

```html
<script src="/editor42/editor42.min.js"></script>

<textarea id="my-editor"></textarea>

<script>
  editor42.init({
    selector: '#my-editor'
  });
</script>
```

Keep the folder whole: `editor42.min.js` loads its plugins, skins, icons, themes and models from the folders next to it.

## Updates

```sh
composer update editor42/editor42
```

The package carries the editor's own version number, so a constraint of `^42` takes every fix release.
