@imdbsd/tiktok-embed
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

Tiktok Embed

React component for embed tiktok video. Created based on tiktok oembed specification.

Instalation

$ yarn add @imdbsd/tiktok-embed

or

$ npm install @imdbsd/tiktok-embed

Usage

Using TiktokEmbed component

// App.tsx

import {TiktokEmbed} from '@imdbsd/tiktok-embed';

const App = () => {
    ...

    return (
        ...
            <TiktokEmbed url="https://www.tiktok.com/@catslums/video/7201281217864535302" />
        ...
    )
}

Using useTiktokOmbed hooks

import {useTiktokOembed} from '@imdbsd/tiktok-embed'

const App = () => {
    const url = "https://www.tiktok.com/@catslums/video/7201281217864535302"
    const {loading, data, error} = useTiktokOembed({ url });
    ...
}

Props / Return

  • TiktokEmbed
props type required/optional description
url string required Tiktok content url
  • useTiktokOembed

Props

props type required/optional description
url string required Tiktok content url

Return

return type description
loading boolean Tiktok content url
data TiktokOembedResponse / null Tiktok oembed return type
error unknown Error Response

Package Sidebar

Install

npm i @imdbsd/tiktok-embed

Weekly Downloads

0

Version

0.1.5

License

none

Unpacked Size

27.5 kB

Total Files

26

Last publish

Collaborators

  • imdbsd