--- title: "Discovery" slug: "150-manage-discovery" updated: 2025-03-19T17:35:05Z published: 2025-03-19T17:35:05Z canonical: "docs.developer.comcast.com/150-manage-discovery" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.developer.comcast.com/llms.txt > Use this file to discover all available pages before exploring further. # Discovery **Discovery Module 1.5.0 | Manage SDK** ## Usage To use the Discovery module, you can import it into your project from the Firebolt SDK: ``` import { Discovery } from '@firebolt-js/manage-sdk' ``` ## Overview Your App likely wants to integrate with the Platform's discovery capabilities. For example to add a "Watch Next" tile that links to your app from the platform's home screen. Getting access to this information requires to connect to lower level APIs made available by the platform. Since implementations differ between operators and platforms, the Firebolt SDK offers a Discovery module, that exposes a generic, agnostic interface to the developer. Under the hood, an underlaying transport layer will then take care of calling the right APIs for the actual platform implementation that your App is running on. The Discovery plugin is used to *send* information to the Platform. ### Localization Apps should provide all user-facing strings in the device's language, as specified by the Firebolt `Localization.language` property. Apps should provide prices in the same currency presented in the app. If multiple currencies are supported in the app, the app should provide prices in the user's current default currency. ## Methods ### listen To listen to a specific event pass the event name as the first parameter: ``` listen(event: string, callback: (data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event to listen for, see [Events](/docs/150-manage-discovery#events). | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Discovery.clear(id)` | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/150-manage-discovery#events). | To listen to all events from this module pass only a callback, without specifying an event name: ``` listen(callback: (event: string, data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see [Events](/docs/150-manage-discovery#events). | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event that has occured listen for, see [Events](/docs/150-manage-discovery#events). | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/150-manage-discovery#events). | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Discovery.clear(id)` | See [Listening for events](/docs/listening-for-events/) for more information and examples. ### once To listen to a single instance of a specific event pass the event name as the first parameter: ``` once(event: string, callback: (data: any) => void): Promise ``` The `once` method will only pass the next instance of this event, and then dicard the listener you provided. Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event to listen for, see [Events](/docs/150-manage-discovery#events). | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Discovery.clear(id)` | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/150-manage-discovery#events). | To listen to the next instance only of any events from this module pass only a callback, without specifying an event name: ``` once(callback: (event: string, data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see [Events](/docs/150-manage-discovery#events). | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event that has occured listen for, see [Events](/docs/150-manage-discovery#events). | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/150-manage-discovery#events). | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Discovery.clear(id)` | See [Listening for events](/docs/listening-for-events/) for more information and examples. ## Events ### signIn ``` function listen('signIn', () => void): Promise ``` See also: [listen()](/docs/150-manage-discovery#listen), [once()](/docs/150-manage-discovery#listen), [clear()](/docs/150-manage-discovery#listen). Event value: Capabilities: | Role | Capability | | --- | --- | | manages | xrn:firebolt:capability:discovery:sign-in-status | #### Examples Default Example JavaScript: ``` import { Discovery } from '@firebolt-js/manage-sdk' Discovery.listen('signIn', (event) => { console.log(event) }) ``` Value of `event`: ``` { "appId": "firecert" } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "Discovery.onSignIn", "params": { "listen": true } } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "appId": "firecert" } } ``` --- ### signOut ``` function listen('signOut', () => void): Promise ``` See also: [listen()](/docs/150-manage-discovery#listen), [once()](/docs/150-manage-discovery#listen), [clear()](/docs/150-manage-discovery#listen). Event value: Capabilities: | Role | Capability | | --- | --- | | manages | xrn:firebolt:capability:discovery:sign-in-status | #### Examples Default Example JavaScript: ``` import { Discovery } from '@firebolt-js/manage-sdk' Discovery.listen('signOut', (event) => { console.log(event) }) ``` Value of `event`: ``` { "appId": "firecert" } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "Discovery.onSignOut", "params": { "listen": true } } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "appId": "firecert" } } ``` --- ## Private Events **View** ### signIn ``` function listen('signIn', () => void): Promise ``` See also: [listen()](/docs/150-manage-discovery#listen), [once()](/docs/150-manage-discovery#listen), [clear()](/docs/150-manage-discovery#listen). Event value: Capabilities: | Role | Capability | | --- | --- | | manages | xrn:firebolt:capability:discovery:sign-in-status | #### Examples Default Example JavaScript: ``` import { Discovery } from '@firebolt-js/manage-sdk' Discovery.listen('signIn', (event) => { console.log(event) }) ``` Value of `event`: ``` { "appId": "firecert" } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "Discovery.onSignIn", "params": { "listen": true } } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "appId": "firecert" } } ``` --- ### signOut ``` function listen('signOut', () => void): Promise ``` See also: [listen()](/docs/150-manage-discovery#listen), [once()](/docs/150-manage-discovery#listen), [clear()](/docs/150-manage-discovery#listen). Event value: Capabilities: | Role | Capability | | --- | --- | | manages | xrn:firebolt:capability:discovery:sign-in-status | #### Examples Default Example JavaScript: ``` import { Discovery } from '@firebolt-js/manage-sdk' Discovery.listen('signOut', (event) => { console.log(event) }) ``` Value of `event`: ``` { "appId": "firecert" } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "Discovery.onSignOut", "params": { "listen": true } } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "appId": "firecert" } } ``` --- ## Types