Skip to content

Instantly share code, notes, and snippets.

@yusukebe
Created June 13, 2026 23:37
Show Gist options
  • Select an option

  • Save yusukebe/80da1ec879c61bee967c81dcd4a457b9 to your computer and use it in GitHub Desktop.

Select an option

Save yusukebe/80da1ec879c61bee967c81dcd4a457b9 to your computer and use it in GitHub Desktop.
import { Hono } from 'hono'
const app = new Hono<{ Bindings: CloudflareBindings }>()
app.get('/my-image', async (c) => {
return c.env.BROWSER.quickAction('screenshot', {
html: (
<html>
<body
style={{
background: 'url("https://avatars.githubusercontent.com/u/10682")',
backgroundSize: 'cover'
}}
>
<h1 style={{ background: 'white', textAlign: 'center' }}>こんにちは!</h1>
</body>
</html>
).toString(),
viewport: { height: 300, width: 300 }
})
})
export default app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment