react-finnhub
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

react-finnhub

Docs and Source

building on finnhub-ts

Usage

Get your API-Key: https://finnhub.io/register

Provider

import { finnhubClient, FinnhubProvider } from 'react-finnhub'

const client = finnhubClient('YOUR-API-KEY')

<FinnhubProvider client={client}>
    <App />
</FinnhubProvider>

Hook

import React, { FunctionComponent, useState } from 'react'
import { BasicFinancials, useFinnhub } from 'react-finnhub'

type ITestProps = {}

export const App: FunctionComponent<ITestProps> = (props) => {
  const finnhub = useFinnhub()
  const [state, setState] = useState<BasicFinancials>()

  finnhub.companyBasicFinancials('AAPL', 'all').then((res) => setState(res.data))

  return <h1>{JSON.stringify(state)}</h1>
}

Package Sidebar

Install

npm i react-finnhub

Weekly Downloads

18

Version

1.0.7

License

MIT

Unpacked Size

16.8 kB

Total Files

7

Last publish

Collaborators

  • ru4ert