# Code snippet OG image template

A dark editor window with line numbers, syntax colours and a file tab, on a background in your accent colour.

- Slug: `code-snippet`
- Preview (real render): https://shareglint.com/img/templates/code-snippet.jpg
- Page: https://shareglint.com/en/templates/code-snippet

For tips, tutorials and launch posts that show the code. Send the code with real line breaks; strings, comments, numbers and common keywords get colours, long lines wrap with their line number kept, and the whole block shrinks when it is long. The first 16 lines are shown.

## Fields

Every field is optional. Long text shrinks to fit instead of overflowing; an image field takes a public URL that we fetch on our side.

| Field | Type | Description | Example |
|---|---|---|---|
| `code` | text | The code, with line breaks. Up to 16 lines are shown. (default: console.log('Hello, world')) | import { render } from '@northwind/og-kit'  // One template, every size const images = await render({   template: 'blog-og',   sizes: ['og', 'square', 'story'],   title: 'Ship faster with signed URLs', })  console.log(images.length) // 3 |
| `title` | text | Headline above the editor. | Render every social size in one call |
| `filename` | text | File name on the editor tab. | render.ts |
| `language` | text | Language label in the editor bar, e.g. TypeScript. | TypeScript |
| `author` | text | Author or handle next to the title. | @mayacodes |
| `site` | text | Your domain or a short URL. | northwind.dev/blog |
| `accent` | colour | Brand colour as hex, e.g. #6366f1. Drives buttons, highlights and the background glow. (default: #6366f1) | #6366f1 |
| `theme` | dark | light | Colour scheme: dark or light. | — |

## Render it with one request

```bash
curl -X POST "https://shareglint.com/v1/images?wait=true" \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "template": "code-snippet",
    "modifications": {
        "code": "import { render } from '\''@northwind/og-kit'\''\n\n// One template, every size\nconst images = await render({\n  template: '\''blog-og'\'',\n  sizes: ['\''og'\'', '\''square'\'', '\''story'\''],\n  title: '\''Ship faster with signed URLs'\'',\n})\n\nconsole.log(images.length) // 3",
        "title": "Render every social size in one call",
        "filename": "render.ts",
        "language": "TypeScript",
        "author": "@mayacodes",
        "site": "northwind.dev/blog"
    }
}'
```

## Make it yours

accent and theme change per request. For anything more, copy the template into your account: you get an ordinary HTML template with the same fields that you can edit in the dashboard or through the API. If the slug is free on your account, the copy takes it — your integrations switch to your version without changing a line.

```bash
curl -X POST "https://shareglint.com/v1/templates/library/code-snippet/copy" -H "Authorization: Bearer sk_live_YOUR_KEY"
```
