Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasHiltl committed Oct 25, 2024
1 parent 7f08b41 commit 1d6873d
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions widget/next/README.md
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>
);
}
```

0 comments on commit 1d6873d

Please sign in to comment.