https://github.com/flagsmith/flagsmith-opengraph
Generates markdown and images about Flagsmith feature flags
https://github.com/flagsmith/flagsmith-opengraph
Last synced: 4 months ago
JSON representation
Generates markdown and images about Flagsmith feature flags
- Host: GitHub
- URL: https://github.com/flagsmith/flagsmith-opengraph
- Owner: Flagsmith
- Created: 2024-05-10T16:42:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-14T16:40:56.000Z (almost 2 years ago)
- Last Synced: 2025-01-16T18:26:04.519Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://flagsmith-opengraph.vercel.app
- Size: 231 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://flagsmith.com/)
Generates an SVG Image preview of feature states in a project using Vercel's [Santori](https://github.com/vercel/satori) project.
## Generating an image:
An image url can be generated by converting an array of items to JWT.
```
export type Item = {
feature_state_value?: string | number;
segment_name?: string;
environment_name: string;
feature_value: boolean;
}
const items: Item[] = [{
"feature_state_value": "Green",
"environment_name": "Production",
"feature_value": true
}]
const url = `https://flagsmith-opengraph.vercel.app/?t=${jwtEncode({payload:items})}
return (
)
```
Result:

## Generating a URL via post request
Alternatively, you can post to the following in order to get a base64 encoded SVG.
```
curl --location 'https://flagsmith-opengraph.vercel.app/api/image/base64' \
--header 'Content-Type: application/json' \
--data '[
{
"feature_state_value": "Blue",
"environment_name": "Development",
"feature_value": true
}
]'
```
See a demo:
https://flagsmith-opengraph.vercel.app/