# wombo-dream-api

> Unofficial API for Wombo Dream

Latest version **0.1.6** (published 2022-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install wombo-dream-api
pnpm add wombo-dream-api
yarn add wombo-dream-api
bun add wombo-dream-api
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2022-07-06 |
| First published | 2022-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 (+25 in 3 direct dependencies) |
| Install scripts | no |
| Author | leopoldhub |
| Maintainers | burngemios3643 |
| Keywords | wombo, dream, api, ai, generated, image |

## Links

- npm: https://www.npmjs.com/package/wombo-dream-api
- Repository: https://github.com/leopoldhub/wombo-dream-api
- Homepage: https://github.com/leopoldhub/wombo-dream-api#readme
- Issues: https://github.com/leopoldhub/wombo-dream-api/issues
- npm.io page: https://npm.io/package/wombo-dream-api

## Dependencies (5)

- [fs](https://npm.io/package/fs.md) ^0.0.1-security
- [axios](https://npm.io/package/axios.md) ^0.26.1
- [sprintf-js](https://npm.io/package/sprintf-js.md) ^1.1.2
- [@types/node](https://npm.io/package/@types/node.md) ^17.0.21
- [sleep-promise](https://npm.io/package/sleep-promise.md) ^9.1.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2022-07-06
- 0.1.5 — 2022-03-19
- 0.1.4-fix — 2022-03-17
- 0.1.4 — 2022-03-17
- 0.1.3-fix — 2022-03-16
- 0.1.2 — 2022-03-16
- 0.1.1-fix — 2022-03-15
- 0.1.0 — 2022-03-12

## README

# wombo-dream-api [![License][license-image]][license-url] [![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads-image]][npm-downloads-url]

Unofficial API for [Wombo Dream](https://app.wombo.art)

<p style="color: lime;">❤ Feel free to contribute to the project ❤ </p>

## Upcomming features

- NFT minting
- change of password/username/email/profile picture
- ability to browse other users' profiles

## Changelog

> ### 0.1.6
>
> - Refactoring
> - Documentation updated
> - API testing

> ### 0.1.5
>
> - Can now fetch tasks shop url
> - Can now save, fetch, fetch all and delete tasks in the gallery

> ### 0.1.4-fix
>
> - Throw error when task generation fails
> - uploaded images **MUST** be jpg/jpeg

> ### 0.1.4
>
> - Using **typedoc** to generate **[Documentation][documentation-url]**
> - Updating **[Documentation][documentation-url]**

## Installation

### node.js

    npm install wombo-dream-api

> Please read the
> **[Documentation][documentation-url]**
> to learn more about the api.

## Example

```javascript
const { buildDefaultInstance } = require('wombo-dream-api');
const fs = require('fs');

(async () => {
	try {
		const credentials = {
			email: 'mysuperemail@gmail.com',
			password: 'mypassword',
		};

		// signin is automatically done when you interract with the api if you pass credentials
		const wombo = buildDefaultInstance(credentials);

		// if you want to sign up as new user:
		// await wombo.authentifier.signUp(credentials);

		// fetch all styles
		const styles = await wombo.fetchStyles();
		console.log(styles.map((style) => `[${style.id}] ${style.name}`));

		// upload image [ONLY JPEG SUPPORTED]
		const uploadedImage = await wombo.uploadImage(
			fs.readFileSync('./image.jpeg')
		);

		// generate picture from image
		const generatedTask = await wombo.generatePicture(
			'mountain',
			styles[0].id,
			(taskInProgress) => {
				console.log(
					`[${taskInProgress.id}]: ${taskInProgress.state} | step: ${taskInProgress.photo_url_list.length}`
				);
			},
			{ mediastore_id: uploadedImage.id, weight: 'HIGH' }
		);

		console.log(
			`[${generatedTask.id}]: ${generatedTask.state} | final url: ${generatedTask.result?.final}`
		);

		// to interract with the gallery, YOU NEED TO HAVE A USERNAME!
		// if you just created the account and it doesn't have a username, set it with:
		// await wombo.setUsername('myusername');

		// save an image in the gallery
		const savedTask = await wombo.saveTaskToGallery(
			generatedTask.id,
			'my wonderful creation',
			true,
			true
		);

		console.log('image saved!');

		// obtain gallery tasks
		const galleryTasks = await wombo.fetchGalleryTasks();

		console.log(galleryTasks);
	} catch (error) {
		console.error(error);
	}
})();
```

> More examples can be found in the **[Documentation][documentation-url]**

## License

[MIT](LICENSE)

[documentation-url]: https://leopoldhub.github.io/wombo-dream-api/
[license-image]: https://img.shields.io/github/license/leopoldhub/wombo-dream-api.svg
[license-url]: https://github.com/leopoldhub/wombo-dream-api/blob/master/LICENSE
[npm-image]: https://img.shields.io/npm/v/wombo-dream-api.svg
[npm-url]: https://www.npmjs.com/package/wombo-dream-api
[npm-downloads-image]: https://img.shields.io/npm/dm/wombo-dream-api.svg
[npm-downloads-url]: https://www.npmjs.com/package/wombo-dream-api

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