@vercel/og 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +25 -17149
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @vercel/og
|
|
2
2
|
|
|
3
|
+
[Satori](https://github.com/vercel/satori) based Open Graph Image generation adapter for Vercel’s [Edge Function](https://vercel.com/docs/concepts/functions/edge-functions).
|
|
4
|
+
|
|
3
5
|
## Basic Usage
|
|
4
6
|
|
|
5
7
|
Install `@vercel/og`, then use it inside Edge API routes in your Next.js project:
|
|
@@ -29,3 +31,5 @@ export default function () {
|
|
|
29
31
|
)
|
|
30
32
|
}
|
|
31
33
|
```
|
|
34
|
+
|
|
35
|
+
The React element will be rendered and responded as a PNG from that Edge Function endpoint. For more details and restrictions in image generation, see [Satori](https://github.com/vercel/satori).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as satori from 'satori';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
|
|
4
|
+
declare module 'satori/wasm' {
|
|
5
|
+
export function init(yoga: any): Promise<any>
|
|
6
|
+
export default function satori_(
|
|
7
|
+
element: react.ReactElement,
|
|
8
|
+
options: satori.SatoriOptions
|
|
9
|
+
): Promise<string>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare module 'yoga-wasm-web' {
|
|
13
|
+
export default function initYoga(wasm: any): Promise<any>
|
|
14
|
+
}
|