https://github.com/useflyyer/proxy
Helper function to proxy images via Flyyer network to bypass CORS with Typescript support for Flyyer.io
https://github.com/useflyyer/proxy
cors flyyer image og-image proxy smartcrop twitter-card typescript
Last synced: 11 months ago
JSON representation
Helper function to proxy images via Flyyer network to bypass CORS with Typescript support for Flyyer.io
- Host: GitHub
- URL: https://github.com/useflyyer/proxy
- Owner: useflyyer
- License: other
- Created: 2021-04-15T02:23:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T00:08:55.000Z (about 3 years ago)
- Last Synced: 2025-06-13T00:03:57.428Z (11 months ago)
- Topics: cors, flyyer, image, og-image, proxy, smartcrop, twitter-card, typescript
- Language: TypeScript
- Homepage: https://flyyer.io
- Size: 1.62 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @flyyer/proxy
Helper function to proxy images via flyyer network to bypass CORS with Typescript support.
We made this for [Flyyer.io](https://flyyer.io?ref=github) to enable developers to create content-aware marketing and social images. Beware this is intended to use inside flyyer templates created with [`create-flyyer-app`](https://github.com/useflyyer/create-flyyer-app).
**Note: This proxy service is only available and allowed for flyyer templates where bypassing CORS is necessary for images or data.**
## Usage
Install this dependency:
```sh
yarn add @flyyer/proxy
```
Common case usage:
```tsx
import { proxy } from "@flyyer/proxy";
export default function MainTemplate({ variables }) {
const src = proxy(variables["image"]);
return
}
```
### Smartcrop

Usage with [`use-smartcrop`](https://github.com/useflyyer/use-smartcrop).
```tsx
import { proxy } from "@flyyer/proxy";
import { useSmartcrop } from "use-smartcrop";
export default function MainTemplate({ width, height, variables }) {
const src = proxy(variables["image"]);
const cropped = useSmartcrop(src, { width, height, minScale: 1 })
return
}
```