Skip to main content

@flayyer/flayyer

Repository: https://github.com/flayyer/flayyer

This module is agnostic to any JS framework and has only one peer dependency: qs

Terminal.app
yarn add @flayyer/flayyer

After installing this module you can format URLs just like this example:

import { FlayyerIO } from "@flayyer/flayyer";
const flayyer = new FlayyerIO({
tenant: "tenant",
deck: "deck",
template: "template",
variables: {
title: "Hello world!",
},
});
// Use this image in your <head/> tags
const url = flayyer.href();
// > https://flayyer.io/v2/tenant/deck/template.jpeg?__v=1596906866&title=Hello+world%21

If you are using React, you should use this URL as content of some of your HTML's head tags to render link previews:

// This is just an illustrative example, it depends on how you are suing React.
function Head() {
return (
<head>
<meta property="og:image" content={url} />
<meta name="twitter:image" content={url} />
</head>
);
}

Take a look into the Next.js or Gatsby.js integration guide to get an idea of how to use this depending on your project setup.

note

For additional information about variables and other terminology please read Concepts.

Last updated on by Patricio López Juri