Embedfy

Embedfy

embedded web contents into your website via API.

Getting Started

Install NPM library for React via Yarn or NPM

$ yarn install @natsuneko-laboratory/embedfy-react

and use it.

import React from "react";

import { Embedfy } from "@natsuneko-laboratory/embedfy-react";

const Component: React.VFC = () => {
  return (
    <div>
      <Embedfy url="https://twitter.com/6jz" />
    </div>
  )
};

Properties

PropertiesExample ValueDescription
urlhttps://twitter.com/6jzurl of getting embedded contents (required)
providerhttps://embedfy.natsuneko.moe/api/API provider endpoint (default: https://embedfy.natsuneko.moe/api/)
typeembedembedded content type (one of: title, embed, or none, default: embed)
height100pxheight of embedded contents (default: auto)
width100%width of embedded contents (default: 100%)

API

EndpointExample ValueReturns
/api/title?url=https://twitter.com/6jzJSON of {"title":"夏ēŒ«šŸ’•ļ¼ˆ@6jzļ¼‰ć•ć‚“ / Twitter","url":"https://twitter.com/6jz"}
/api/embed?url=https://twitter.com/6jzHTML contents for iframe