useLaunchConfig

Returns a reactive accessor for the parameters the app was launched with

import { useLaunchConfig } from "@roku-sdk/runtime/launch-config";
useLaunchConfig<T extends LaunchParams = LaunchParams>(): { launchParams: Accessor<T> }

Description

Returns a reactive accessor for the parameters the app was launched with.

launchParams holds the launch parameters as string key-value pairs, such as a deep link's contentId and mediaType. It is an empty object until the runtime delivers the parameters, and it updates when the runtime reports new ones. Pass a type argument to name the parameters your app expects.

Return values

An object with a launchParams accessor.

Example

const { launchParams } = useLaunchConfig<{ contentId: string; mediaType: string }>();
createEffect(() => console.log("Deep link:", launchParams().contentId));

What’s Next

Did this page help you?