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
Properties | Example Value | Description |
---|---|---|
url | https://twitter.com/6jz | url of getting embedded contents (required) |
provider | https://embedfy.natsuneko.moe/api/ | API provider endpoint (default: https://embedfy.natsuneko.moe/api/ ) |
type | embed | embedded content type (one of: title , embed , or none , default: embed ) |
height | 100px | height of embedded contents (default: auto ) |
width | 100% | width of embedded contents (default: 100% ) |
API
Endpoint | Example Value | Returns |
---|---|---|
/api/title | ?url=https://twitter.com/6jz | JSON of {"title":"å¤ē«šļ¼@6jzļ¼ćć / Twitter","url":"https://twitter.com/6jz"} |
/api/embed | ?url=https://twitter.com/6jz | HTML contents for iframe |