Setup and Configuration

Install

npm install @tigeropenapi/tigeropen

Configure

createClientConfig(options?: ClientConfigOptions): ClientConfig must ultimately resolve tigerId and privateKey. Precedence is environment variables, code options, properties file, then defaults. The SDK searches ./tiger_openapi_config.properties and ~/.tigeropen/tiger_openapi_config.properties by default.

FieldTypeDefault or constraint
tigerId, privateKeystringRequired; environment variables are TIGEROPEN_TIGER_ID and TIGEROPEN_PRIVATE_KEY
account, secretKeystringTrading account; secretKey is for institutional accounts
languagestringzh_CN
timeoutnumber15 seconds
tokenstringUsed by licenses such as TBHK that require a token
serverUrl, quoteServerUrlstringPin explicitly or allow dynamic resolution
enableDynamicDomainbooleantrue
tiger_id=your_tiger_id
private_key=your_rsa_private_key
account=your_account
secret_key=your_institution_secret
license=TBUS

Never commit private keys, tokens, or secretKey. See Quick Start and Account Types for activation and account restrictions.


Did this page help you?