Skip to main content
Every configuration field has a sensible default. FeedConfig() with no arguments produces a working feed.

ShortKit initializer

On initialization, the SDK pre-fetches the first feed page, pre-warms the CDN connection, and begins HLS preroll for the first video. The feed view controller can render immediately without a loading spinner.

FeedConfig

Horizontal feed

Set scrollAxis to .horizontal for a left/right swipe feed instead of the default vertical (up/down) feed. Each cell still fills the full feed container — only the swipe direction changes.

FeedFilter

FeedFilter controls which content the SDK fetches from the server. When set on FeedConfig, all feed requests (initial load, pagination, and pull-to-refresh) automatically apply the filter. When nil, the full unfiltered feed is returned. Different filter fields are combined with AND logic — content must match all specified fields. Tags use OR logic within the tags array — content matching any of the provided tags is included. The exclusion fields (excludeTags, excludeSections, excludeAuthors, excludeContentTypes, excludeMetadata) remove content instead: content matching any exclusion is left out, even if it matches every other field. See Excluding content.

Excluding content

Use the exclusion fields to keep specific content out of a feed, for example a viewer’s own posts, authors they’ve blocked, or content rated above an age limit. ShortKit removes excluded content server-side before it builds each page, so pagination and pull-to-refresh never return it.
  • Content matching any exclusion is left out. Exclusions take priority over the other fields.
  • Each exclusion matches the same way as its counterpart: excludeTags against content tags, excludeSections, excludeAuthors, and excludeContentTypes by exact match, and excludeMetadata against custom metadata values.
  • Content that doesn’t carry the field is never excluded. An item with no authorId metadata key stays in a feed that excludes authorId: ["user_8f3a2c"].
  • A filter that sets only exclusion fields doesn’t change how your feed is ordered; excluded items are skipped. Leave the other fields unset rather than empty. An empty list counts as set, and setting any of them returns filtered results instead.
  • Exclusions are sent with every feed request. Keep each list to a few hundred values.
To exclude a viewer’s own posts, store the poster’s ID in custom metadata when you upload each item (for example customMetadata: {"authorId": "user_8f3a2c"}), then exclude that key for the signed-in viewer.
Changing the filter on a feed that’s already on screen reloads it from the top. Set exclusions you already know about, such as the signed-in viewer’s own posts, on FeedConfig when you create the feed.

Filtering by language

ShortKit automatically detects the spoken language in every video and stores it as customMetadata.language using a BCP 47 code. Use this with metadata to serve a language-specific feed without any extra work on upload.
Common language codes: "en" English, "es" Spanish, "fr" French, "de" German, "it" Italian, "pt" Portuguese, "ja" Japanese, "ko" Korean, "zh" Chinese, "ar" Arabic, "hi" Hindi. "und" indicates no detectable speech (music or ambient audio). Language is set asynchronously — it appears on the content object within a few minutes of the video reaching ready status.

Complete example

A full initialization with all configuration options set explicitly.
App.swift