Skip to main content
This page documents all configuration options available when initializing the shortkit SDK.

Initialization parameters

apiKey
string
required
Your organization’s publishable API key. Starts with pk_live_ or pk_test_.
config
FeedConfig
required
Configuration object defining feed layout, controls, and behavior. See sections below.
environment
string
default:"production"
Target environment. One of production, staging, or development. Controls API endpoint and logging verbosity.
remoteConfigTTL
number
default:"300"
Cache TTL for remote configuration overlay, in seconds.
remoteConfigTimeout
number
default:"2000"
Timeout for remote config fetch, in milliseconds. If exceeded, falls back to cached or code-level config.

Feed layout

feedOrientation
string
default:"vertical"
Primary scroll direction of the feed.
ValueDescription
verticalSwipe up/down between videos (TikTok-style)
horizontalSwipe left/right between videos
feedHeight
string | object
default:"fullscreen"
Height of the feed view.
ValueDescription
fullscreenOccupies entire screen minus safe areas
{ percentage: 0.85 }Percentage of container (e.g., 85%)
contentTypes
string[]
default:"[\"video\"]"
Types of content the feed can display.
ValueDescription
videoVideo content (default)
photoSetSwipeable photo carousels
adjacentFeeds
FeedConfig[]
default:"[]"
Additional feeds accessible by horizontal swipe from the primary feed. Each can have its own filters and ranking.
entryWidget
EntryWidgetConfig | null
default:"null"
Configuration for embeddable mini-player widgets. See Entry widget.

Example

const config = {
  feedOrientation: 'vertical',
  feedHeight: 'fullscreen',
  contentTypes: ['video'],
  adjacentFeeds: [
    {
      name: 'Sports',
      filter: { tags: ['sports'] }
    },
    {
      name: 'Politics',
      filter: { tags: ['politics'] }
    }
  ]
};

Video controls

Each control can be independently enabled or disabled.
controls.playPause
boolean
default:"true"
Tap-to-pause/play overlay.
controls.scrubber
boolean
default:"true"
Progress bar / seek scrubber. Position configurable via scrubberPosition.
controls.scrubberPosition
string
default:"bottom"
Position of the scrubber. One of bottom or below (below video for non-fullscreen).
controls.playbackSpeed
PlaybackSpeedConfig
Playback speed selector configuration.
controls.captions
CaptionConfig
Caption/subtitle configuration.
controls.volume
boolean
default:"true"
Mute/unmute toggle.
controls.muteOnStart
boolean
default:"true"
Whether videos start muted. Unmute state persists across videos in the session.
controls.resolutionSelector
boolean
default:"false"
Manual resolution override. When disabled, resolution is managed automatically via ABR (recommended).
controls.pictureInPicture
boolean
default:"false"
Picture-in-Picture mode support. Requires platform configuration.
controls.airplay
boolean
default:"false"
AirPlay casting support (iOS only).
controls.chromecast
boolean
default:"false"
Chromecast support. Requires Google Cast SDK.
controls.share
ShareConfig
Share button configuration.
controls.autoHideControls
AutoHideConfig
Auto-hide behavior for control overlays.

Example

const config = {
  controls: {
    playPause: true,
    scrubber: true,
    playbackSpeed: {
      enabled: true,
      options: [0.5, 1.0, 1.5, 2.0]
    },
    captions: {
      enabled: true,
      defaultOn: false
    },
    volume: true,
    muteOnStart: true,
    share: {
      enabled: true,
      deepLinkPathTemplate: '/watch/{contentId}'
    },
    autoHideControls: {
      enabled: true,
      delayMs: 4000
    }
  }
};

Custom actions

Configure custom action buttons in the control overlay:
actions
ActionConfig[]
default:"[]"
Array of custom action button configurations.
const config = {
  actions: [
    {
      id: 'bookmark',
      icon: 'bookmark',
      label: 'Save',
      position: 'right'
    },
    {
      id: 'readMore',
      icon: 'newspaper',
      label: 'Read Article',
      position: 'bottom'
    }
  ]
};

Entry widget configuration

Configure mini-player widgets for embedding in other screens:
entryWidget.style
string
default:"thumbnailRow"
Widget display style.
ValueDescription
thumbnailRowHorizontal row of thumbnail previews
thumbnailGridGrid of thumbnail previews
carouselHorizontal carousel with larger previews
entryWidget.itemCount
number
default:"6"
Number of content items to display.
entryWidget.autoPlay
boolean
default:"false"
Whether to auto-play preview animations on hover/focus.
entryWidget.previewType
string
default:"thumbnail"
Preview content type.
ValueDescription
thumbnailStatic first-frame thumbnail
gifAnimated preview GIF (first 2-3 seconds)
const config = {
  entryWidget: {
    style: 'thumbnailRow',
    itemCount: 5,
    autoPlay: true,
    previewType: 'gif'
  }
};

Feed filters

Filter content displayed in the feed:
filter.tags
string[]
Only show content with at least one of these tags.
filter.excludeTags
string[]
Exclude content with any of these tags.
filter.contentIds
string[]
Only show specific content IDs (useful for curated playlists).
filter.maxAgeDays
number
Only show content published within the last N days.
const config = {
  filter: {
    tags: ['breaking-news', 'politics'],
    excludeTags: ['opinion'],
    maxAgeDays: 7
  }
};

Performance options

performance.prefetchCount
number
default:"3"
Number of upcoming videos to pre-buffer.
performance.thumbnailPrefetchCount
number
default:"6"
Number of upcoming thumbnails to prefetch.
performance.initialBufferMs
number
default:"2000"
Target buffer before starting playback, in milliseconds.
performance.lowPowerMode
boolean
default:"true"
Whether to reduce quality when device is in low-power mode.
performance.preferAV1
boolean
default:"true"
Whether to prefer AV1 codec when hardware decode is available. AV1 offers better quality at lower bitrate.
const config = {
  performance: {
    prefetchCount: 2,
    thumbnailPrefetchCount: 4,
    initialBufferMs: 1500,
    lowPowerMode: true,
    preferAV1: true
  }
};

Complete example

import { shortkit } from '@shortkit/web';

shortkit.initialize({
  apiKey: 'pk_live_your_publishable_key',
  environment: 'production',
  remoteConfigTTL: 300,
  remoteConfigTimeout: 2000,
  config: {
    // Layout
    feedOrientation: 'vertical',
    feedHeight: 'fullscreen',
    contentTypes: ['video'],

    // Controls
    controls: {
      playPause: true,
      scrubber: true,
      playbackSpeed: {
        enabled: true,
        options: [1.0, 1.25, 1.5, 2.0]
      },
      captions: {
        enabled: true,
        defaultOn: false
      },
      volume: true,
      muteOnStart: true,
      pictureInPicture: true,
      share: {
        enabled: true,
        deepLinkPathTemplate: '/watch/{contentId}'
      },
      autoHideControls: {
        enabled: true,
        delayMs: 3000
      }
    },

    // Custom actions
    actions: [
      { id: 'bookmark', icon: 'bookmark', label: 'Save' }
    ],

    // Theming (see Theming page for full options)
    theme: {
      primaryColor: '#FF6600',
      controlsTint: '#FFFFFF',
      backgroundColor: '#000000'
    },

    // Performance
    performance: {
      prefetchCount: 3,
      thumbnailPrefetchCount: 6,
      preferAV1: true
    },

    // Filters
    filter: {
      excludeTags: ['draft']
    }
  }
});

Next steps