Skip to main content

Getting started

What's this documentation for

You'll learn to create your own templates, which you can use for your link previews, download social media formats, or offer them in the Marketplace.

Alternatively, you can integrate Flyyer to manage link previews and social media images enriched from your website (no effort required). You can choose templates that are already available. Check it out before coming here.

Create deck#

Create a new Flyyer app using create-flyyer-app, which sets up everything automatically for you. To start a deck follow the steps below.

Using Yarn will create a folder called my-deck in your current directory:

Terminal.app
yarn create flyyer-app my-deck

You will be prompted for startup configurations. Choose the one that best suits your needs.

? Select the best template setup for you โ€ฆ  You can customize the template laterreactreact-styled-componentsreact-typescript-styled-componentsreact-typescript-tailwindvuevue-typescript

Your first template#

CLI

For more details about the available commands refer to Command-Line Interface.

Create (if you don't have) a file with the desired name of your template in a directory called templates. Every deck created with create-flyyer-app starts with a file named templates/main.js, template/main.tsx, or template/main.vue.

Let's take https://github.com/useflyyer/create-flyyer-app/tree/master/templates/react as example

DECK-NAME/โ”‚   ...โ”œโ”€โ”€ templates/โ”‚   โ””โ”€โ”€ main.js
templates/main.js
import React from "react";import background from "../static/background.jpg";import logo from "../static/logo.svg";import "./styles.css"
// Make sure to 'export default' a React componentexport default function MainTemplate({ variables }) {  const { title = "Hello world!", img = background, description, } = variables;
  return (    <div>      <div className="layer background" style={{ backgroundImage: `url("${img}")` }} />      <div className="layer fade" />      <div className="layer content">        <img className="logo" src={logo} />        <h1 className="title">          {title}        </h1>        {description && (          <span className="description">            {description}          </span>        )}      </div>    </div>  );}

Start the development server with:

Terminal.app
yarn start
caution

Please use Google Chrome, Firefox or Opera. Safari is not widely supported.

This command starts a development server using Parcel.js. Then open Flyyer Studio in your browser for a better developer experience.

Flyyer Studio screenshot

Deploy#

Work on your template, try changing the variables and when you are ready, run:

Terminal.app
NODE_ENV=production yarn build

To upload the final bundled templates to our cloud you must have an API Key.

Click here to manage your keys ๐Ÿ”‘

When you are ready to deploy, run:

Terminal.app
yarn run deploy

If everything is correct, you should see an output with your templates' URLs.

๐Ÿ–ผ Created template with URL: https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.jpeg

Congratulations! You deployed your first Flyyer deck! ๐ŸŽ‰

Resultant flyyer live image

Resultant flyyer live image

Here are some examples of how to pass parameters to create images:

  • Set extension
    • https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.png
    • https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.jpeg
    • https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.webp
  • Set dimensions:
    • Instagram post: https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.jpeg?_w=1080&_h=1080
    • Whatsapp image: https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.jpeg?_w=400&_h=400
    • Story: https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.jpeg?_w=1080&_h=1920
  • Replace variables:
    • https://cdn.flyyer.io/render/v2/TENANT/DECK/TEMPLATE.jpeg?title=New+title

To format URL we recommend using one of official libraries.

cat on a rocket

Continue reading this documentation to understand more about Flyyer and what other amazing features we support.