# @machinat/next

> This package is an underlying module of webview platform for serving a [Next.js](https://nextjs.org) web front-end. You might want to use [`@machinat/webview`](https://github.com/machinat/machinat/tree/master/packages/webview) unless you want to serve you

Latest version **0.6.0** (published 2022-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @machinat/next
pnpm add @machinat/next
yarn add @machinat/next
bun add @machinat/next
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2022-06-08 |
| First published | 2020-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 23.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Patrick Liu |
| Maintainers | lrills0515, lrills |

## Links

- npm: https://www.npmjs.com/package/@machinat/next
- Repository: https://github.com/machinat/machinat
- Homepage: https://github.com/machinat/machinat#readme
- Issues: https://github.com/machinat/machinat/issues
- npm.io page: https://npm.io/package/@machinat/next

## Dependencies (1)

- [invariant](https://npm.io/package/invariant.md) ^2.2.4

## Recent versions

- 0.6.0 (latest) — 2022-06-08
- 0.6.0-beta.0 (beta) — 2022-04-17
- 0.6.0-canary.0 (canary) — 2022-03-29
- 0.5.0 — 2022-02-18
- 0.5.0-beta.43 — 2022-02-03
- 0.5.0-beta.40 — 2022-01-24
- 0.5.0-beta.36 — 2022-01-22
- 0.5.0-beta.32 — 2022-01-21
- 0.5.0-beta.14 — 2021-12-29
- 0.5.0-beta.1 — 2021-07-31
- 0.5.0-beta.0 — 2021-07-30
- 0.4.1-alpha.47 — 2021-07-08
- 0.4.1-alpha.34 — 2021-06-07
- 0.4.1-alpha.33 — 2021-06-07
- 0.4.1-alpha.29 — 2021-06-06
- … 13 more at https://npm.io/package/@machinat/next/versions

## README

# Next Module

This package is an underlying module of webview platform for serving a [Next.js](https://nextjs.org)
web front-end. You might want to use [`@machinat/webview`](https://github.com/machinat/machinat/tree/master/packages/webview)
unless you want to serve your own web service.

## Install

```bash
npm install @machinat/core @machinat/http @machinat/next
# or with yarn
yarn add @machinat/core @machinat/http @machinat/next
```

## Docs

Check the [package reference](https://machinat.com/api/modules/next.html).

## Setup

Assume you have the Next.js project at `../webview`, set up the module like
this:

```js
import Machinat from '@machinat/core';
import Http from '@machinat/http';
import Next from '@machinat/next';
import nextConfigs from '../webview/next.config.js'

const DEV = process.env.NODE_ENV !== 'production';

const app = Machinat.createApp({
  modules: [
    Http.initModule({ /* ... */ }),
    Next.initModule({
      entryPath: '/webview',   // have to match bastPath in next configs
      serverOptions: {
        dev: DEV,              // start with dev mode or not
        dir: '../webview',     // next.js app project dir
        conf: nextConfigs,     // imported next configs
      },
    }),
  ],
});
```

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