### Install Impossible FX Go SDK Source: https://impossible.io/docs/sdks Install the SDK using go get. Requires Go 1.21+ and no external dependencies. ```bash go get github.com/impossiblesoftware/impossible-fx-sdk/v3/go ``` -------------------------------- ### Quick setup with FXPlayer Source: https://impossible.io/docs/integrations/video-players Include the player CSS and script, add a container div, and create a player with your project details. The player makes the render request, streams via HLS, and starts playback automatically. ```html
``` -------------------------------- ### GET /v2/get/{token}.{ext} Source: https://impossible.io/docs/api-reference Progressive download. Starts delivering as frames become available. ```APIDOC ## GET /v2/get/{token}.{ext} ### Description Progressive download. Starts delivering as frames become available. ### Method GET ### Endpoint /v2/get/{token}.{ext} ### Parameters #### Path Parameters - **token** (string) - Required - The render token. - **ext** (string) - Required - The file extension (e.g., mp4). ### Response #### Success Response (200) Returns the video file as it becomes available. ``` -------------------------------- ### List all projects (cURL, Node, Python) Source: https://impossible.io/docs/project-api Returns a list of all projects in your account. The cURL example uses the GET /v1/list/project endpoint. The Node example uses the ImpossibleFX client with listProjects(). The Python example uses the impossiblefx client with list_projects(). ```bash curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api-eu-west-1.impossible.io/v1/list/project ``` ```javascript import { ImpossibleFX } from "impossiblefx"; const client = new ImpossibleFX(); client.config.apikey = "YOUR_API_KEY"; client.config.region = "eu-west-1"; const projects = await client.listProjects(); ``` ```python import impossiblefx as fx client = fx.Client( api_key="YOUR_API_KEY", region="eu-west-1" ) projects = client.list_projects() ``` -------------------------------- ### Installation via NPM Source: https://impossible.io/docs/integrations/video-players Install the `fxplayer` package and import it in your code. ```bash npm install fxplayer ``` ```javascript import { FXPlayer } from "fxplayer"; import "fxplayer/dist/fxplayer.css"; ``` -------------------------------- ### Delayed Start: Content Offset Example Source: https://impossible.io/docs/editor/video-elements Shows how to delay video playback while the element appears immediately. Set Element In Time to 0s and Content Offset to 2s to make the element visible right away but start the video after 2 seconds. ```plaintext Element In Time: 0s Content Offset: 2s Result: Element visible immediately, video plays at 2s ``` -------------------------------- ### Staggered Videos: Content Offset Example Source: https://impossible.io/docs/editor/video-elements Shows how to start multiple videos at different times. Set each video's In Time to 0s and use increasing Content Offset values (0s, 1s, 2s) so the videos appear together but play sequentially. ```plaintext Video 1: In Time 0s, Offset 0s Video 2: In Time 0s, Offset 1s Video 3: In Time 0s, Offset 2s Result: Videos appear together, play sequentially ``` -------------------------------- ### fxplayer CTA overlays example Source: https://impossible.io/docs/examples/fxplayer-cta Complete HTML/JavaScript example that creates an fxplayer instance and adds three CTAs: a timed promo (5s-12s), a persistent subscribe pill (from 3s), and an end-screen with a sign-up button. Includes event listeners for CTA show/hide/click and hides timed CTAs when the video ends. ```html
``` -------------------------------- ### Transform examples Source: https://impossible.io/docs/editor/variables Examples of applying transforms to a variable value. ```text {firstName|upper} {firstName|title} {firstName|substr(0,1)|upper|possessive} ``` -------------------------------- ### GET /v1/list/sdl/{project-uid} Source: https://impossible.io/docs/project-api Lists all dynamic movies in a project. ```APIDOC ## GET /v1/list/sdl/{project-uid} ### Description List all dynamic movies in a project. ### Method GET ### Endpoint /v1/list/sdl/{project-uid} ### Parameters #### Path Parameters - **project-uid** (string) - Required - The unique identifier of the project. ### Response #### Success Response (200) - **body** (array) - List of dynamic movies. #### Response Example [ { "name": "welcome-video", "sdl": "..." } ] ``` -------------------------------- ### GET /v1/list/data/{project-uid} Source: https://impossible.io/docs/project-api Lists all assets in a project. ```APIDOC ## [GET] /v1/list/data/{project-uid} ### Description Returns a list of all assets in a project. ### Method GET ### Endpoint /v1/list/data/{project-uid} ### Parameters #### Path Parameters - **project-uid** (String) - Required - The unique project identifier. ### Request Example ``` curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api-eu-west-1.impossible.io/v1/list/data/abc123-def456 ``` ### Response #### Success Response (200) - **assets** (array) - List of assets in the project. #### Response Example ``` { "assets": [ { "filename": "background.mp4", "size": 1234567 } ] } ``` ``` -------------------------------- ### GET /v1/list/project Source: https://impossible.io/docs/project-api Returns a list of all projects in your account. ```APIDOC ## GET /v1/list/project ### Description Returns a list of all projects in your account. ### Method GET ### Endpoint /v1/list/project ### Parameters None ### Request Example curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api-eu-west-1.impossible.io/v1/list/project ### Response #### Success Response (200) - **projects** (array) - List of projects #### Response Example { "projects": [] } ``` -------------------------------- ### Date variable: Created on {date} Source: https://impossible.io/docs/editor/text-elements Date example using the {date} variable. ```plaintext Created on {date} ``` -------------------------------- ### Complete welcome video JSON Source: https://impossible.io/docs/advanced/sdl Complete example of a 10-second welcome video with a background video, a personalized text overlay with fade-in animation, a logo, and background music. It includes video and audio parameters, a scene with 250 frames, and multiple tracks. ```json { "params": { "vparams": { "width": 1920, "height": 1080, "videocodec": "VIDEO_X264", "videobitrate": 5000, "videoframerate": { "num": 25, "den": 1 } }, "aparams": { "audiocodec": "AUDIO_AAC", "audioabr": 128000, "audiosamplerate": 44100 } }, "scenes": [ { "numframes": 250, "tracks": [ { "content": { "type": "video", "source": { "path": "background.mp4" } }, "transformations": [ { "type": "scalingcrop", "scale": [1920, 1080] } ] }, { "content": { "type": "textsimple", "source": { "path": "fonts/Montserrat-Bold.ttf" }, "text": { "type": "format", "formatstring": "Welcome, {0}!", "formatvariables": [ { "type": "map", "key": "name", "defaultvalue": "Friend" } ] }, "fontsize_d": 72, "color": { "red": 255, "green": 255, "blue": 255 }, "width": 1600, "height": 200, "xalignment": "centered", "yalignment": "middle" }, "centerx": true, "y": 440, "opacity": 0.0, "opacityfunction": { "type": "linear", "param1": 0.0, "param2": 1.0, "innerfunction": { "type": "timed", "param1": 0.0, "param2": 0.15 } } }, { "content": { "type": "stillimage", "source": { "path": "logo.png" } }, "x": 60, "y": 60 } ], "audio": { "audiotracks": [ { "type": "video_mix", "source": { "path": "music.mp4" }, "volume": 0.4, "volumefunction": { "type": "linear", "param1": 0.0, "param2": 1.0, "innerfunction": { "type": "timed", "param1": 0.0, "param2": 0.08 } } } ] } } ] } ``` -------------------------------- ### Installation via CDN Source: https://impossible.io/docs/integrations/video-players Include the player CSS and script from the CDN. No build step needed; the script adds `fxplayer.FXPlayer` to the global scope. ```html ``` -------------------------------- ### Video Sync Timing Pattern Source: https://impossible.io/docs/editor/timeline Sync captions to video by setting In Times that match when the speaker starts or reaches key points. The example shows a video starting at 0s, caption 1 at 2s, and caption 2 at 5s. ```text Video: In 0s, no offset Caption 1: In 2s (when speaker starts) Caption 2: In 5s (next point) ``` -------------------------------- ### Prompt to create a project and build a video Source: https://impossible.io/docs/quickstart/mcp Use this prompt to have the agent create a project and then build the video template. The agent will ask which region to create the project in. ```text Create a project for this and build me a personalized insurance premium quote video with FX Express. Three scenes: … ``` -------------------------------- ### TypeScript Async Render with Progress Polling Source: https://impossible.io/docs/sdks Start an async render, get a token, build the URL, and poll for progress until the render completes. ```typescript import { ImpossibleFX } from 'impossiblefx'; const client = new ImpossibleFX({ region: 'us-east-1', apiKey: process.env.IMPOSSIBLE_API_KEY, }); // Start an async render const result = await client.render('my-project', 'welcome-video', { name: 'Alex', }, { format: 'mp4', async: true }); console.log('Token:', result.token); // Build the URL from the token const url = client.getUrl(result.token, 'mp4'); console.log('URL:', url); // Poll for progress (only available for async renders) let progress = await client.getProgress(result.token); while (progress.done < progress.total) { await new Promise((r) => setTimeout(r, 1000)); progress = await client.getProgress(result.token); console.log(`Progress: ${progress.done}/${progress.total}`); } console.log('Render complete!'); ``` -------------------------------- ### TypeScript Quick Start - Synchronous Render Source: https://impossible.io/docs/sdks Initialize the client with region and API key, then perform a synchronous render that waits for completion and returns the URL. ```typescript import { ImpossibleFX } from 'impossiblefx'; const client = new ImpossibleFX({ region: 'us-east-1', apiKey: process.env.IMPOSSIBLE_API_KEY, }); // Synchronous render — waits for completion and returns the URL const result = await client.render('my-project', 'welcome-video', { name: 'Alex', company: 'Acme Inc', }, { format: 'mp4' }); console.log(result.url); ``` -------------------------------- ### Content Offset Example Source: https://impossible.io/docs/editor/timeline Shows how content offset shifts video playback relative to element visibility. With element at 0s and offset 2s, the element appears at 0s while video starts at 2s. ```text Element In Time: 0s Content Offset: 2s Result: Element visible at 0s, video plays at 2s ``` -------------------------------- ### Retrieve video with token-based URL Source: https://impossible.io/docs/rendering Use this URL to retrieve a rendered video with the token-based flow. The URL pattern is GET https://render.impossible.io/v2/{mode}/{token}.{format}. The example uses the render mode with an MP4 format. ```text https://render.impossible.io/v2/render/v2:eu-west-1:abc123-def456-789.mp4 ``` -------------------------------- ### Product Demo Video Settings Source: https://impossible.io/docs/editor/video-elements Recommended settings for a product demo video: Object Fit Contain, not muted (or with voiceover), no loop, autoplay enabled. ```plaintext Object Fit: Contain Muted: No (or with voiceover) Loop: No Autoplay: Yes ``` -------------------------------- ### Install ImpossibleFX Browser via NPM Source: https://impossible.io/docs/sdks Install the impossiblefx-browser package using npm. ```bash npm install impossiblefx-browser ``` -------------------------------- ### Install ImpossibleFX Python via pip Source: https://impossible.io/docs/sdks Install the impossible-fx package using pip. Requires Python 3.9+. ```bash pip install impossible-fx ``` -------------------------------- ### Python: Synchronous Render Source: https://impossible.io/docs/sdks Create a client with an API key and render a video synchronously, waiting for completion and printing the resulting URL. ```python from impossible_fx import ImpossibleFX client = ImpossibleFX(region="us-east-1", api_key="your-api-key") # Synchronous render — waits for completion and returns the URL result = client.render( project_id="my-project", movie="welcome-video", params={"name": "Alex", "company": "Acme Inc"}, format="mp4", ) print(result.url) ``` -------------------------------- ### Impossible.io FXPlayer integration with constructor, setMovie, and setToken options Source: https://impossible.io/docs/examples/fxplayer-impossible-io Integrates the ImpossibleFX Render API into a web page. Loads the fxplayer v3 CSS and JavaScript from the CDN, creates a 16:9 container, and shows three ways to configure the player: via the constructor with projectId, movie, region, and params; by calling setMovie and setParams after construction; or by using setToken with a pre-existing token. The example uses start and end parameters to control the counter range. ```html
``` -------------------------------- ### Initialize HLS stream with fxplayer Source: https://impossible.io/docs/examples/fxplayer-hls Sets up an HLS player with auto-format detection. Includes the fxplayer CSS and JS from CDN, a player div, and initialization with a sample HLS stream URL. Listens for 'ready' and 'error' events. ```html
``` -------------------------------- ### Install ImpossibleFX SDK (TypeScript/Node.js) Source: https://impossible.io/docs/sdks Install the official TypeScript/Node.js SDK for the Impossible FX Render API. Requires Node.js 18+. ```bash npm install impossiblefx ``` -------------------------------- ### FXPlayer with VTT tracks and dynamic addSubtitleTrack Source: https://impossible.io/docs/examples/fxplayer-subtitles Complete HTML/JavaScript example showing two players: one with subtitles configured at construction, and another where a subtitle track is added after initialization using addSubtitleTrack(). Includes CSS and JS CDN links. ```html
``` -------------------------------- ### Create a project (cURL) Source: https://impossible.io/docs/project-api Creates a new empty project with the given name. The name is a URL path parameter and must be unique within your account. The response includes the project UID for subsequent calls. ```bash curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \ https://api-eu-west-1.impossible.io/v1/project/my-new-project ``` -------------------------------- ### Example Video URL Response from Webhook Source: https://impossible.io/docs/integrations/others Example JSON response returned by the Respond to Webhook node, containing the constructed video URL. ```json { "videoUrl": "https://render.impossible.io/v2/render/v2:eu-west-1:abc123.mp4" } ```