Download the PHP package justinholtweb/craft-tokr without Composer

On this page you can find all versions of the php package justinholtweb/craft-tokr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package craft-tokr

Tokr

TikTok feeds for Craft CMS 5.

Connect a TikTok account once, and Tokr keeps a local copy of its profile and videos in your database. Front-end requests read from that copy, so your pages never wait on TikTok's API — and never break when it's slow.

Requirements

Installation

Or find Tokr in the Craft Plugin Store.

Tokr is a single paid edition, $99 one-off. There is no free tier and nothing is gated — the plugin you install is the whole plugin.

Setting up the TikTok app

  1. Create an app at developers.tiktok.com.
  2. Add the Login Kit and Display API products.
  3. Under Login Kit, add a redirect URI. Tokr shows the exact value it expects at Settings → Plugins → Tokr; it looks like https://example.com/tokr/oauth/callback. TikTok requires HTTPS and an exact match.
  4. Request the scopes you need: user.info.basic and video.list are required, user.info.profile gets you the bio and username, and user.info.stats gets you follower and like counts.
  5. Copy the client key and secret into Tokr's settings. Both fields accept environment variables — $TIKTOK_CLIENT_SECRET — which is the right way to handle the secret.

While your app is in TikTok's sandbox, only accounts you've added as target users can be connected.

Connecting an account

Tokr → Accounts → Connect an account sends you through TikTok's authorization screen and back. Tokr stores the access and refresh tokens encrypted with your securityKey and renews the access token on its own.

TikTok refresh tokens last a year. When one expires the account is flagged Needs reconnecting on the Accounts screen and you'll need to run through authorization again.

Feeds

A feed is a saved set of display options. Create one under Tokr → Feeds, give it a handle, and render it:

That's the whole integration. Everything else — layout, column counts, captions, click behavior — is configured in the control panel.

Building your own markup

If you'd rather write the HTML yourself:

Overriding the bundled template

Create _tokr/feed.twig in your own templates folder and Tokr will render it instead of its own, passing feed, account, and videos. Copy vendor/justinholtweb/craft-tokr/src/templates/_frontend/feed.twig as a starting point.

Twig reference

Call Returns
craft.tokr.render('handle') The rendered feed markup
craft.tokr.render('handle', { … }) Same, with extra template variables
craft.tokr.feed('handle') A Feed model
craft.tokr.feeds() Every feed
craft.tokr.videos('handle') A feed's Video models
craft.tokr.account('@username') An Account model, by username or ID
craft.tokr.accounts() Every connected account

Video properties: videoId, caption, captionHtml, title, description, coverImageUrl, url, embedUrl, duration, durationFormatted, aspectRatio, width, height, likeCount, commentCount, shareCount, viewCount, postedAt, account.

Account properties: name, username, handle, displayName, avatarUrl, bioDescription, profileUrl, isVerified, followerCount, followingCount, likesCount, videoCount, isConnected, dateRefreshed.

Keeping feeds fresh

By default, the first front-end request after a feed goes stale queues a background refresh job, and the page renders from what's already stored.

The more predictable option is cron:

If you go the cron route, turn off Refresh in the background in the settings so front-end requests never queue anything.

About thumbnail expiry

TikTok's cover_image_url values are signed and stop working roughly six hours after they're issued. This is a TikTok constraint, not a Tokr one. Keep the refresh interval below six hours (Tokr caps it at five) so thumbnails are always replaced before they die.

Settings

Settings live at Settings → Plugins → Tokr, or in config/tokr.php:

scopes is only settable from the config file. Only request scopes your TikTok app has actually been approved for — Tokr drops fields it wasn't granted rather than failing the request, but asking for an unapproved scope fails authorization outright.

Styling

Tokr registers one stylesheet that scopes everything under .tokr and reads a handful of custom properties, so you can restyle without overriding much:

Set Include Tokr's CSS to off to drop it entirely.

Permissions

Two permissions, both under Tokr in the user group settings:

Documentation

Full docs at justinholt.com/plugins/craft-tokr/docs.

License

See LICENSE.md. Tokr is commercial software licensed per production environment.


All versions of craft-tokr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
craftcms/cms Version ^5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package justinholtweb/craft-tokr contains the following files

Loading the files please wait ...