Tokr for Craft CMS

For Craft CMS 5.3+

TikTok feeds that don't depend on TikTok

Most feed plugins call TikTok's API while your page is rendering, then cache the result and hope. Tokr connects once, stores the profile and the videos in your own database, and renders from local rows. When TikTok is slow, your page isn't. When TikTok is down, your visitors can't tell.

Tokr

One line, then never again

A feed is a saved set of display options with a handle. Layout, columns, captions and click behaviour all live on the feed, so changing how it looks is a control-panel job rather than a deploy.

twig
{# the whole integration #}
{{ craft.tokr.render('homepage') }}

{# or take the data and write your own markup #}
{% for v in craft.tokr.videos('homepage') %}
  <img src="{{ v.coverImageUrl }}" alt="{{ v.caption }}">
  {{ v.captionHtml }}
  <p>{{ v.likeCount|number }} likes · {{ v.durationFormatted }}</p>
{% endfor %}

Features

Stored videos, a refresh cycle, and markup you can take over at three different levels.

Renders from your database

Videos live in your own tables and are read like any other query. TikTok is contacted by a queue job or a cron run — never in the middle of rendering a page.

  • An API outage stops updates, not your site
  • No third-party JavaScript on the page

Four layouts, three breakpoints

Grid, masonry, carousel and list, each with independent desktop, tablet and mobile column counts.

  • Breakpoints are container queries, not viewport ones
  • A feed in a sidebar gets its mobile columns on a desktop screen

Connect once, it stays connected

Official TikTok Login Kit. Tokens are stored encrypted with your securityKey, and the access token renews itself for as long as the refresh token lives.

  • A dead token is a status on the account, not an outage
  • The feed keeps rendering stored videos until you reconnect

Markup you can take over

Use the built-in template, drop a _tokr/feed.twig in your own templates to replace the markup while keeping the lightbox and the stylesheet, or ignore both and loop the models yourself.

Refreshes on a schedule you choose

Let a stale request queue a background job, or drive the whole thing from cron and turn the queue path off. Either way one job runs per interval, however many visitors arrive.

  • php craft tokr/refresh exits non-zero when a token has died

Built for the control panel

Accounts and feeds are managed screens, not a settings blob. Two permissions let editors arrange feeds without being able to disconnect the account underneath.

Frequently Asked Questions

The questions worth answering before you install it.

Stop rendering other people's downtime

$99 one-off, per production environment. Nothing is gated, and the feed keeps working when TikTok doesn't.