This package has been deprecated

Author message:

WARNING: This project has been renamed to @flyyer/proxy. Install using @flyyer/proxy instead. https://npmjs.com/package/@flyyer/proxy

@flayyer/proxy
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@flayyer/proxy

Helper function to proxy images via Flayyer network to bypass CORS with Typescript support.

We made this for Flayyer.com to enable developers to create content-aware marketing and social images. Beware this is intended to use inside Flayyer templates created with create-flayyer-app.

Note: This proxy service is only available and allowed for Flayyer templates where bypassing CORS is necessary for images or data.

Usage

Install this dependency:

yarn add @flayyer/proxy

Common case usage:

import { proxy } from "@flayyer/proxy";

export default function MainTemplate({ variables }) {
  const src = proxy(variables["image"]);
  return <img src={src} />
}

Smartcrop

example image

Usage with use-smartcrop.

import { proxy } from "@flayyer/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 <img src={cropped.src} />
}

Package Sidebar

Install

npm i @flayyer/proxy

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

15.5 kB

Total Files

8

Last publish

Collaborators

  • francomendez
  • lopezjurip