Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meldiron/almost-bannerbear

Function to dynamically generate OG images for your web app.
https://github.com/meldiron/almost-bannerbear

appwrite

Last synced: 4 days ago
JSON representation

Function to dynamically generate OG images for your web app.

Awesome Lists containing this project

README

        

![Cover](docs/og-image.png)

# ⚡ Node.js OG Image Generator Function

Function to dynamically generate OG images for your web app.

## 🧰 Usage

### GET /

Returns HTML website with form to build your OG image HTML tag.

**Response**

Sample `200` Response:

```html
...
```

![HTML page](docs/builder.png)

### GET /image.png

Returns PNG of generated OG image.

**Parameters**

| Name | Description | Location | Type | Sample Value |
| ----- | ---------------------------------------------------------------------------- | -------- | ------ | ------------- |
| title | Page title | URL | String | `Hello World` |
| url | URL of page to genrate subtitle | FormURL | String | `/template` |
| icon | Icon name from [Heroicons](https://heroicons.com/) to use in OG image design | URL | String | `globe-alt` |

**Response**

`200` Response:

```json
(image buffer)
```

## ⚙️ Configuration

| Setting | Value |
| ----------------- | ------------- |
| Runtime | Node (18.0) |
| Entrypoint | `src/main.js` |
| Build Commands | `npm install` |
| Permissions | `any` |
| Timeout (Seconds) | 15 |

## 🔒 Environment Variables

### THEME

Toggle between dark and light theme for OG image.

| Question | Answer |
| ------------- | ----------------- |
| Required | No |
| Sample Value | `dark` or `light` |
| Default Value | `dark` |

### BRAND_COLOR

Hex color of your brand to personalize OG image color scheme.

| Question | Answer |
| ------------- | --------- |
| Required | No |
| Sample Value | `#3b82f6` |
| Default Value | `#f02e65` |

### BRAND_NAME

Name of your company used when generating OG image.

| Question | Answer |
| ------------- | ---------- |
| Required | No |
| Sample Value | `Appwrite` |
| Default Value | `Website` |

## 📽️ Demo

https://github.com/Meldiron/og-image-generator/assets/19310830/726e1d96-e594-4be3-898a-6400bba82dc9