-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f08b41
commit 1d6873d
Showing
1 changed file
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,40 @@ | ||
# Openchangelog Next Widget | ||
# Openchangelog Next.js Widget | ||
|
||
Embed your Changelog into your Next.js app. | ||
A Next.js Server Component to embed your Openchangelog changelog into your Next.js app. | ||
|
||
## Installation | ||
``` | ||
npm i @openchangelog/next | ||
``` | ||
|
||
## Usage | ||
```ts | ||
import { Changelog } from "@openchangelog/next" | ||
|
||
|
||
export default function ChangelogPage() { | ||
return ( | ||
<Changelog | ||
workspaceID="ws_xxxx" // when using Openchangelog cloud | ||
changelogID="cl_xxxx" // when using Openchangelog cloud | ||
baseUrl="https://your-changelog-instance.com" // when self-hosting | ||
theme="dark" | ||
/> | ||
); | ||
} | ||
``` | ||
|
||
## Suspense | ||
The `Changelog` component is built as an async component, making it compatible with React Suspense. You can wrap it in a Suspense boundary to show loading states while the changelog data is being fetched: | ||
|
||
```ts | ||
import { Changelog } from "@openchangelog/next" | ||
|
||
export default function ChangelogPage() { | ||
return ( | ||
<Suspense fallback={<div>Loading changelog...</div>}> | ||
<Changelog /> | ||
</Suspense> | ||
); | ||
} | ||
``` |