[youtubei.js](../../../../README.md) / [YTNodes](../README.md) / NavigationEndpoint # Class: NavigationEndpoint Defined in: [src/parser/classes/NavigationEndpoint.ts:19](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L19) ## Extends - [`YTNode`](../../Helpers/classes/YTNode.md) ## Constructors ### Constructor > **new NavigationEndpoint**(`data`): `NavigationEndpoint` Defined in: [src/parser/classes/NavigationEndpoint.ts:32](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L32) #### Parameters ##### data [`RawNode`](../../../../type-aliases/RawNode.md) #### Returns `NavigationEndpoint` #### Overrides [`YTNode`](../../Helpers/classes/YTNode.md).[`constructor`](../../Helpers/classes/YTNode.md#constructor) ## Properties ### command? > `optional` **command**: [`YTNode`](../../Helpers/classes/YTNode.md) \| [`YTNode`](../../Helpers/classes/YTNode.md) & [`IEndpoint`](../../../../interfaces/IEndpoint.md)\<`any`\> Defined in: [src/parser/classes/NavigationEndpoint.ts:29](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L29) *** ### commands? > `optional` **commands**: `NavigationEndpoint`[] Defined in: [src/parser/classes/NavigationEndpoint.ts:30](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L30) *** ### dialog? > `optional` **dialog**: [`YTNode`](../../Helpers/classes/YTNode.md) \| [`CreatePlaylistDialog`](CreatePlaylistDialog.md) \| `null` Defined in: [src/parser/classes/NavigationEndpoint.ts:24](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L24) *** ### metadata > **metadata**: `Metadata` Defined in: [src/parser/classes/NavigationEndpoint.ts:28](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L28) *** ### modal? > `optional` **modal**: [`YTNode`](../../Helpers/classes/YTNode.md) \| [`ModalWithTitleAndButton`](ModalWithTitleAndButton.md) \| `null` Defined in: [src/parser/classes/NavigationEndpoint.ts:25](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L25) *** ### name? > `optional` **name**: `string` Defined in: [src/parser/classes/NavigationEndpoint.ts:22](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L22) *** ### next\_endpoint? > `optional` **next\_endpoint**: `NavigationEndpoint` Defined in: [src/parser/classes/NavigationEndpoint.ts:27](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L27) *** ### open\_popup? > `optional` **open\_popup**: [`OpenPopupAction`](OpenPopupAction.md) \| `null` Defined in: [src/parser/classes/NavigationEndpoint.ts:26](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L26) *** ### payload > **payload**: `any` Defined in: [src/parser/classes/NavigationEndpoint.ts:23](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L23) *** ### type > `readonly` **type**: `string` Defined in: [src/parser/helpers.ts:8](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/helpers.ts#L8) #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`type`](../../Helpers/classes/YTNode.md#type) *** ### type > `static` **type**: `string` = `'NavigationEndpoint'` Defined in: [src/parser/classes/NavigationEndpoint.ts:20](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L20) #### Overrides [`YTNode`](../../Helpers/classes/YTNode.md).[`type`](../../Helpers/classes/YTNode.md#type-1) ## Methods ### as() > **as**\<`T`, `K`\>(...`types`): `InstanceType`\<`K`\[`number`\]\> Defined in: [src/parser/helpers.ts:29](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/helpers.ts#L29) Cast to one of the given types. #### Type Parameters ##### T `T` *extends* [`YTNode`](../../Helpers/classes/YTNode.md) ##### K `K` *extends* [`YTNodeConstructor`](../../Helpers/interfaces/YTNodeConstructor.md)\<`T`\>[] #### Parameters ##### types ...`K` The types to cast to #### Returns `InstanceType`\<`K`\[`number`\]\> The node cast to one of the given types #### Throws If the node is not of the given type #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`as`](../../Helpers/classes/YTNode.md#as) *** ### call() #### Call Signature > **call**\<`T`\>(`actions`, `args`): `Promise`\<`T`\> Defined in: [src/parser/classes/NavigationEndpoint.ts:121](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L121) ##### Type Parameters ###### T `T` *extends* [`IParsedResponse`](../../../../interfaces/IParsedResponse.md) ##### Parameters ###### actions [`Actions`](../../../../classes/Actions.md) ###### args ###### parse `true` ##### Returns `Promise`\<`T`\> #### Call Signature > **call**(`actions`, `args?`): `Promise`\<[`ApiResponse`](../../../../interfaces/ApiResponse.md)\> Defined in: [src/parser/classes/NavigationEndpoint.ts:122](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L122) ##### Parameters ###### actions [`Actions`](../../../../classes/Actions.md) ###### args? ###### parse? `false` ##### Returns `Promise`\<[`ApiResponse`](../../../../interfaces/ApiResponse.md)\> *** ### ~~getPath()~~ > **getPath**(`name`): `"/browse"` \| `"/player"` \| `"/search"` \| `"/next"` \| `"/live_chat/get_item_context_menu"` \| `undefined` Defined in: [src/parser/classes/NavigationEndpoint.ts:105](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L105) Sometimes InnerTube does not return an API url, in that case the library should set it based on the name of the payload object. #### Parameters ##### name `string` #### Returns `"/browse"` \| `"/player"` \| `"/search"` \| `"/next"` \| `"/live_chat/get_item_context_menu"` \| `undefined` #### Deprecated This should be removed in the future. *** ### hasKey() > **hasKey**\<`T`, `R`\>(`key`): `this is NavigationEndpoint & { [k in string]: R }` Defined in: [src/parser/helpers.ts:41](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/helpers.ts#L41) Check for a key without asserting the type. #### Type Parameters ##### T `T` *extends* `string` ##### R `R` = `any` #### Parameters ##### key `T` The key to check #### Returns `this is NavigationEndpoint & { [k in string]: R }` Whether the node has the key #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`hasKey`](../../Helpers/classes/YTNode.md#haskey) *** ### is() > **is**\<`T`, `K`\>(...`types`): `this is InstanceType` Defined in: [src/parser/helpers.ts:19](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/helpers.ts#L19) Check if the node is of the given type. #### Type Parameters ##### T `T` *extends* [`YTNode`](../../Helpers/classes/YTNode.md) ##### K `K` *extends* [`YTNodeConstructor`](../../Helpers/interfaces/YTNodeConstructor.md)\<`T`\>[] #### Parameters ##### types ...`K` The type to check #### Returns `this is InstanceType` whether the node is of the given type #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`is`](../../Helpers/classes/YTNode.md#is) *** ### key() > **key**\<`T`, `R`\>(`key`): [`Maybe`](../../Helpers/classes/Maybe.md) Defined in: [src/parser/helpers.ts:51](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/helpers.ts#L51) Assert that the node has the given key and return it. #### Type Parameters ##### T `T` *extends* `string` ##### R `R` = `any` #### Parameters ##### key `T` The key to check #### Returns [`Maybe`](../../Helpers/classes/Maybe.md) The value of the key wrapped in a Maybe #### Throws If the node does not have the key #### Inherited from [`YTNode`](../../Helpers/classes/YTNode.md).[`key`](../../Helpers/classes/YTNode.md#key) *** ### toURL() > **toURL**(): `string` \| `undefined` Defined in: [src/parser/classes/NavigationEndpoint.ts:143](https://github.com/LuanRT/YouTube.js/blob/faaf5fc5c15ff93eac8442b2fbdb4767d9a47b3f/src/parser/classes/NavigationEndpoint.ts#L143) #### Returns `string` \| `undefined`