# kmidjourney

> Node.js client for the unofficial MidJourney API.

Latest version **1.1.14** (published 2023-05-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install kmidjourney
pnpm add kmidjourney
yarn add kmidjourney
bun add kmidjourney
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.14 |
| Published | 2023-05-21 |
| First published | 2023-05-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 3 |
| Unpacked size | 45.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eric Yang |
| Maintainers | kevin142857 |
| Keywords | midjourney-api, midjourney |

## Links

- npm: https://www.npmjs.com/package/kmidjourney
- Repository: https://github.com/kevinn142857/midjourney-api
- Homepage: https://github.com/erictik/midjourney-api#readme
- Issues: https://github.com/erictik/midjourney-api/issues
- npm.io page: https://npm.io/package/kmidjourney

## Dependencies (3)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0
- [throat](https://npm.io/package/throat.md) ^6.0.2
- [p-queue](https://npm.io/package/p-queue.md) ^6.6.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.1.14 (latest) — 2023-05-21
- 1.1.13 — 2023-05-14
- 1.1.12 — 2023-05-13
- 1.1.11 — 2023-05-13
- 1.1.10 — 2023-05-13
- 1.1.9 — 2023-05-13
- 1.1.8 — 2023-05-12
- 1.1.7 — 2023-05-12
- 1.1.6 — 2023-05-12
- 1.1.5 — 2023-05-12
- 1.1.4 — 2023-05-12
- 1.1.3 — 2023-05-12
- 1.1.2 — 2023-05-12
- 1.1.1 — 2023-05-12
- 1.1.0 — 2023-05-12

## README

# midjourney-api

Node.js client for the unofficial MidJourney API.

<div align="center">
	<p>
		<a href="https://discord.gg/GavuGHQbV4"><img src="https://img.shields.io/discord/1082500871478329374?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
		<a href="https://www.npmjs.com/package/midjourney"><img src="https://img.shields.io/npm/v/midjourney.svg?maxAge=3600" alt="npm version" /></a>
	</p>
</div>

[discord bot example](https://github.com/erictik/midjourney-discord-wrapper/)

[web ui example](https://github.com/erictik/midjourney-ui/)


## Install

npm

```bash
npm i midjourney
```

yarn

```bash
yarn add midjourney
```

## Usage

```typescript
import { Midjourney } from "midjourney";
const client = new Midjourney(
  process.env.SERVER_ID,
  process.env.CHANNEL_ID,
  process.env.SALAI_TOKEN
);
const msg = await client.Imagine("A little pink elephant", (uri: string) => {
  console.log("loading", uri);
});
console.log({ msg });
```

## Example

To run the included example, you must have [Node.js](https://nodejs.org/en/) installed. Then, run the following commands in the root directory of this project:

1. clone the repository

```bash
git clone https://github.com/erictik/midjourney-api.git
cd midjourney-api
```

2. install dependencies

```bash
yarn
# or npm
npm install
```

3. set the environment variables
   [How to get your Discord SALAI_TOKEN:](https://www.androidauthority.com/get-discord-token-3149920/)

```bash
export SERVER_ID="108250087147832934"
export CHANNEL_ID="109489299228171884"
export SALAI_TOKEN="your-salai-token"
```

Then, run the example with the following command:

```bash
npx tsx example/imagine.ts
```

```bash
npx tsx example/upscale.ts
```

```bash
npx tsx example/variation.ts
```

---
_Source: https://npm.io/package/kmidjourney · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
