DeveloperDocumentation

PickFlick Widget SDK

Complete reference for embedding PickFlick widgets on your website.

#Installation

Add the SDK script to your HTML page. This is the only script you need to load.

html
<script src="https://app.pickflick.xyz/developer/sdk/pickflick.js?key=demo"></script>

The SDK automatically registers all custom elements when loaded.

#Quick Start

Here's a minimal example showing an IPTV source widget:

html
<pickflick-source-element orientation="horizontal">
  <pickflick-source-request 
    type="xtreme" 
    host="example.com" 
    username="user123" 
    password="pass123">
  </pickflick-source-request>
  <pickflick-source-all-content></pickflick-source-all-content>
</pickflick-source-element>

#API Key

During beta, use key=demo in the script URL. Production API keys will be available soon.

Note: The demo key is rate-limited. For production use, contact us for a dedicated key.

#pickflick-source-element

The main container for displaying IPTV source information with QR code.

Attributes

AttributeTypeDefaultDescription
orientation"horizontal" | "vertical""vertical"Layout direction
truncation-preferredbooleanfalseTruncate long URLs

Example

html
<pickflick-source-element orientation="vertical">
  <!-- Child elements go here -->
</pickflick-source-element>

#pickflick-source-request

Configures the source credentials. Must be a child of pickflick-source-element.

Attributes (Xtreme)

AttributeTypeDefaultDescription
type"xtreme"-Source type
hoststring-IPTV server hostname
usernamestring-Account username
passwordstring-Account password

Attributes (URL)

AttributeTypeDefaultDescription
type"url"-Source type
urlstring-M3U/playlist URL

#Content Elements

Control which content is displayed in the source widget.

Shorthand Elements

  • pickflick-source-all-content - Show all available content
  • pickflick-source-standard-content - Show default content

Individual Elements

  • pickflick-source-qr - QR code for scanning
  • pickflick-source-status - Connection status
  • pickflick-source-expiry - Expiration date
  • pickflick-source-actions - Copy/share buttons
  • pickflick-attribution - PickFlick attribution

#CSS Variables

Customize the appearance using CSS custom properties. All color values support light-dark() for automatic theme switching.

AttributeTypeDefaultDescription
--pickflick-color-primarycolorlight-dark(#4f46e5, #818cf8)Primary accent color
--pickflick-color-surfacecolorlight-dark(#fff, #18181b)Background color
--pickflick-color-bordercolorlight-dark(#d4d4d8, #52525b)Border color
--pickflick-color-on-surfacecolorlight-dark(#18181b, #f4f4f5)Text color
--pickflick-qr-sizelength100pxQR code dimensions
--pickflick-paddinglength1.25remInternal padding

Example

css
pickflick-source-element {
  --pickflick-color-primary: light-dark(#7c3aed, #a78bfa);
  --pickflick-color-surface: light-dark(#faf5ff, #2e1065);
  --pickflick-qr-size: 120px;
}

#importLibrary()

For programmatic usage, use the importLibrary()method to lazily load specific components.

javascript
// Load the widgets library
const { SourceElement, MediaDetailElement } = await pickflick.importLibrary('widgets');

// Create element programmatically
const source = document.createElement('pickflick-source-element');
source.orientation = 'horizontal';
source.initFromXtreme({
  host: 'example.com',
  username: 'user123',
  password: 'pass123'
});

document.body.appendChild(source);

#pickflick-media-list-element

Display curated lists of movies and TV shows. Perfect for "Popular on Netflix" or custom collections.

Attributes

AttributeTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Scroll direction
compactbooleanfalseCompact card style (200px width)

Example

html
<pickflick-media-list-element orientation="horizontal">
  <pickflick-media-keyword-search-request 
    query="Popular on Netflix"
    network="213">
  </pickflick-media-keyword-search-request>
</pickflick-media-list-element>

#Request Elements

Configure the data source for the media list using one of these request elements.

pickflick-media-keyword-search-request

Fetch media by keyword search, optionally filtered by network.

AttributeTypeDefaultDescription
querystring-Search query (e.g., 'Popular on Netflix')
networkstring-TMDB network ID (213=Netflix, 1024=Prime)

pickflick-media-ids-request

Fetch specific media items by their TMDB IDs.

AttributeTypeDefaultDescription
idsstring-Comma-separated TMDB IDs (e.g., '550,680,120')
type"movie" | "tv""movie"Media type

Common Network IDs

  • 213 - Netflix
  • 1024 - Amazon Prime Video
  • 2552 - Apple TV+
  • 453 - Hulu
  • 2739 - Disney+

#Events

Listen to widget lifecycle events:

AttributeTypeDefaultDescription
pickflick-loadCustomEvent-Fired when widget loads successfully
pickflick-errorCustomEvent<{message: string}>-Fired on error
pickflick-status-changeCustomEvent<{status: AccountStatus}>-Account status updated
javascript
element.addEventListener('pickflick-load', () => {
  console.log('Widget loaded!');
});

element.addEventListener('pickflick-error', (e) => {
  console.error('Widget error:', e.detail.message);
});