HomeGuidesAPI ReferenceChangelog
GuidesAPI ReferenceCommunityDiscordBlogFAQBug BountyAnnouncementsChange Log
API Reference

setHeader

Set the API Key parameters of all TronWeb API requests

❗️

Note:

It needs to be set only when using the Trongrid service. For API Key parameter application and use, please refer to document.

Usage

tronWeb.setHeader({"TRON-PRO-API-KEY": 'your api key'});

Parameter
Object

Returns
No return value

Example

const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey)
tronWeb.setHeader({ "TRON-PRO-API-KEY": '25f66928-0b70-48cd-9ac6-da6f8247c663' });