New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ogis

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ogis

TypeScript client for OGIS OpenGraph image generation service

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

ogis: Open Graph Images as a Service

GitHub Actions Workflow Status Docker Pulls Docker Image Size npm License

Generate beautiful Open Graph images via URL. No design skills required.

OGIS Example

Quick Start

Install the SDK:

npm install ogis

Next.js (App Router)

// app/blog/[slug]/page.tsx
import { OgisClient } from 'ogis';

const ogis = new OgisClient({ baseUrl: 'https://img.ogis.dev' });

export async function generateMetadata({ params }) {
  const post = await getPost(params.slug);

  return {
    openGraph: {
      images: [ogis.generateUrl({
        title: post.title,
        description: post.excerpt,
        template: 'twilight'
      })]
    }
  };
}

SvelteKit

<script lang="ts">
  import { OgisClient } from 'ogis';

  const ogis = new OgisClient({ baseUrl: 'https://img.ogis.dev' });
  const ogImage = ogis.generateUrl({
    title: 'My Page',
    template: 'minimal'
  });
</script>

<svelte:head>
  <meta property="og:image" content={ogImage} />
  <meta property="og:image:width" content="1200" />
  <meta property="og:image:height" content="630" />
</svelte:head>

Astro

---
import { OgisClient } from 'ogis';

const ogis = new OgisClient({ baseUrl: 'https://img.ogis.dev' });
const ogImage = ogis.generateUrl({
  title: frontmatter.title,
  description: frontmatter.description
});
---

<head>
  <meta property="og:image" content={ogImage} />
</head>

Nuxt

<script setup lang="ts">
import { OgisClient } from 'ogis';

const ogis = new OgisClient({ baseUrl: 'https://img.ogis.dev' });

useSeoMeta({
  ogImage: ogis.generateUrl({
    title: 'My Page',
    template: 'modern'
  })
});
</script>

Plain HTML / Any Framework

No SDK needed - just construct the URL:

<meta property="og:image" content="https://img.ogis.dev/?title=Hello%20World&template=twilight" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />

Templates

Browse all templates at ogis.dev/playground.

Twilight
twilight
Daybreak
daybreak
Minimal
minimal
Stripe
stripe
Gradient Aurora
gradient-aurora
Hero
hero

Parameters

All parameters are optional and passed as query parameters or SDK options.

ParameterDescriptionExample
titleMain heading textMy Blog Post
descriptionSecondary text below titleA deep dive into...
subtitleSmall text above titleTutorial
templateTemplate name (see above)twilight
logoURL to logo imagehttps://example.com/logo.png
imageURL to background/hero imagehttps://example.com/hero.jpg

Templates may support additional color customization parameters. See the playground for template-specific options.

Self-Hosting

Deploy on Railway Deploy to Google Cloud

Docker

docker run -d -p 3000:3000 twango/ogis:latest

Docker Compose

docker compose up -d

From Source

cargo build --release
./target/release/ogis

Configuration

Configure via environment variables (prefixed with OGIS_) or CLI arguments:

Environment VariableCLI ArgumentDefaultDescription
OGIS_PORT--port3000Server port
OGIS_HOST--host0.0.0.0Server host
OGIS_HMAC_SECRET--hmac-secret-Enable HMAC authentication
OGIS_DEFAULT_TEMPLATE--default-templatetwilightDefault template
OGIS_MAX_INPUT_LENGTH--max-input-length500Max text length
OGIS_CACHE_SIZE--cache-size1000Image cache size

Run ogis --help for all options.

Authentication

For private instances, enable HMAC-SHA256 signature validation:

# Server
docker run -d -p 3000:3000 -e OGIS_HMAC_SECRET=your-secret twango/ogis:latest
// Client
const ogis = new OgisClient({
  baseUrl: 'https://your-instance.com',
  hmacSecret: process.env.OGIS_SECRET
});

// URLs are automatically signed
const url = ogis.generateUrl({ title: 'Secure Image' });
// => https://your-instance.com/?title=Secure+Image&signature=abc123...

See Authentication docs for details.

Documentation

License

AGPL-3.0

Keywords

opengraph

FAQs

Package last updated on 16 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts