- Notifications
You must be signed in to change notification settings - Fork0
Helper function to proxy images via Flyyer network to bypass CORS with Typescript support for Flyyer.io
License
NotificationsYou must be signed in to change notification settings
useflyyer/proxy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Helper function to proxy images via flyyer network to bypass CORS with Typescript support.
We made this forFlyyer.io to enable developers to create content-aware marketing and social images. Beware this is intended to use inside flyyer templates created withcreate-flyyer-app
.
Note: This proxy service is only available and allowed for flyyer templates where bypassing CORS is necessary for images or data.
Install this dependency:
yarn add @flyyer/proxy
Common case usage:
import{proxy}from"@flyyer/proxy";exportdefaultfunctionMainTemplate({ variables}){constsrc=proxy(variables["image"]);return<imgsrc={src}/>}
Usage withuse-smartcrop
.
import{proxy}from"@flyyer/proxy";import{useSmartcrop}from"use-smartcrop";exportdefaultfunctionMainTemplate({ width, height, variables}){constsrc=proxy(variables["image"]);constcropped=useSmartcrop(src,{ width, height,minScale:1})return<imgsrc={cropped.src}/>}
About
Helper function to proxy images via Flyyer network to bypass CORS with Typescript support for Flyyer.io
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published