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.
<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:
<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
| Attribute | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | "vertical" | Layout direction |
| truncation-preferred | boolean | false | Truncate long URLs |
Example
<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)
| Attribute | Type | Default | Description |
|---|---|---|---|
| type | "xtreme" | - | Source type |
| host | string | - | IPTV server hostname |
| username | string | - | Account username |
| password | string | - | Account password |
Attributes (URL)
| Attribute | Type | Default | Description |
|---|---|---|---|
| type | "url" | - | Source type |
| url | string | - | M3U/playlist URL |
#Content Elements
Control which content is displayed in the source widget.
Shorthand Elements
pickflick-source-all-content- Show all available contentpickflick-source-standard-content- Show default content
Individual Elements
pickflick-source-qr- QR code for scanningpickflick-source-status- Connection statuspickflick-source-expiry- Expiration datepickflick-source-actions- Copy/share buttonspickflick-attribution- PickFlick attribution
#CSS Variables
Customize the appearance using CSS custom properties. All color values support light-dark() for automatic theme switching.
| Attribute | Type | Default | Description |
|---|---|---|---|
| --pickflick-color-primary | color | light-dark(#4f46e5, #818cf8) | Primary accent color |
| --pickflick-color-surface | color | light-dark(#fff, #18181b) | Background color |
| --pickflick-color-border | color | light-dark(#d4d4d8, #52525b) | Border color |
| --pickflick-color-on-surface | color | light-dark(#18181b, #f4f4f5) | Text color |
| --pickflick-qr-size | length | 100px | QR code dimensions |
| --pickflick-padding | length | 1.25rem | Internal padding |
Example
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.
// 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
| Attribute | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | "horizontal" | Scroll direction |
| compact | boolean | false | Compact card style (200px width) |
Example
<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.
| Attribute | Type | Default | Description |
|---|---|---|---|
| query | string | - | Search query (e.g., 'Popular on Netflix') |
| network | string | - | TMDB network ID (213=Netflix, 1024=Prime) |
pickflick-media-ids-request
Fetch specific media items by their TMDB IDs.
| Attribute | Type | Default | Description |
|---|---|---|---|
| ids | string | - | Comma-separated TMDB IDs (e.g., '550,680,120') |
| type | "movie" | "tv" | "movie" | Media type |
Common Network IDs
213- Netflix1024- Amazon Prime Video2552- Apple TV+453- Hulu2739- Disney+
#Events
Listen to widget lifecycle events:
| Attribute | Type | Default | Description |
|---|---|---|---|
| pickflick-load | CustomEvent | - | Fired when widget loads successfully |
| pickflick-error | CustomEvent<{message: string}> | - | Fired on error |
| pickflick-status-change | CustomEvent<{status: AccountStatus}> | - | Account status updated |
element.addEventListener('pickflick-load', () => {
console.log('Widget loaded!');
});
element.addEventListener('pickflick-error', (e) => {
console.error('Widget error:', e.detail.message);
});