Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathan249/dynamic-og
dynamically generate images on the edge
https://github.com/jonathan249/dynamic-og
Last synced: about 5 hours ago
JSON representation
dynamically generate images on the edge
- Host: GitHub
- URL: https://github.com/jonathan249/dynamic-og
- Owner: jonathan249
- Created: 2024-03-02T16:35:25.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-02T17:39:51.000Z (10 months ago)
- Last Synced: 2024-11-12T00:16:26.689Z (about 2 months ago)
- Language: TypeScript
- Size: 93.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dynamic-og
Dynamically generate images on the edge
Documentation for `generateOgImage` Function The generateOgImage function is a function that accepts an object of type OGFnProps as a parameter and returns an ImageResponse object.
## Usage
```tsx
import { generateOgImage, type GenerateOgImageProps } from 'dynamic-og';const props: GenerateOgImageProps = {
width: 1200,
height: 630,
debug: false,
children:Hello World,
emoji: 'twemoji',
className: 'custom-class',
};const imageResponse = generateOgImage({ props });
```## Parameters
The function accepts an object with the following properties:
- ``props``: An object of type OGFnProps with the following properties:
- ``width``: The width of the image.
- ``height``: The height of the image.
- ``debug``: A boolean value indicating whether debug mode is enabled or not.
- ``children``: React nodes to be rendered as children of the image.
- ``emoji``: The type of emoji to use. Can be one of the following values: 'blobmoji', 'fluent', 'fluentFlat', 'noto', 'openmoji', 'twemoji'.
- ``className``: Style the wrapping container of the image respone## Return Value
The function returns an ImageResponse object that represents the generated image.