npm package: @risecx/whoop-integrator-react
Description: Made with create-react-library
Author: Cristofer Domingues
Latest version: 1.1.1

# whoop-integrator-react

> Made with create-react-library

[![NPM](https://img.shields.io/npm/v/whoop-integrator-react.svg)](https://www.npmjs.com/package/whoop-integrator-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save whoop-integrator-react
```

## Usage

# Authenticator

```jsx
import React, { Component } from 'react'

import { WhoopAuthenticator, UserCycles } from 'whoop-integrator-react'
import 'whoop-integrator-react/dist/index.css'

class Example extends Component {
  render() {
    return (
      <WhoopAuthenticator
        credentials={{
          client_id: 'carespace',
          client_secret: 'z7wMP7Kr6RYVHPhV',
          scope: 'offline read:recovery read:cycles read:sleep read:workout',
          redirect_uris: ['https://localhost/callback']
        }}
      >
        <UserCycles
          onSuccess={(result) => {
            console.log(result)
          }}
          onFail={(error) => {
            console.error(error)
          }}
          limit={25}
          startTime={new Date('2020-01-01').getTime()}
          endTime={new Date().getTime()}
        >
          <div>Use Cycles result here</div>
        </UserCycles>
      </WhoopAuthenticator>
    )
  }
}
```

# User Cycles

```jsx
import React, { Component } from 'react'

import { UserCycles } from 'whoop-integrator-react'
import 'whoop-integrator-react/dist/index.css'

class Example extends Component {
  render() {
    return (
      <UserCycles
        onSuccess={(result) => {
          console.log(result)
        }}
        onFail={(error) => {
          console.error(error)
        }}
        limit={25}
        startTime={new Date('2020-01-01').getTime()}
        endTime={new Date().getTime()}
      >
        <div>User Cycles result here</div>
      </UserCycles>
    )
  }
}
```

# User Journals

```jsx
import React, { Component } from 'react'

import { UserJournals } from 'whoop-integrator-react'
import 'whoop-integrator-react/dist/index.css'

class Example extends Component {
  render() {
    return (
      <UserJournal
        onSuccess={(result) => {
          console.log(result)
        }}
        onFail={(error) => {
          console.error(error)
        }}
        cycleId={1}
      >
        <div>User Journals result here</div>
      </UserJournal>
    )
  }
}
```

# User Profile

```jsx
import React, { Component } from 'react'

import { UserProfile } from 'whoop-integrator-react'
import 'whoop-integrator-react/dist/index.css'

class Example extends Component {
  render() {
    return (
      <UserProfile
        onSuccess={(result) => {
          console.log(result)
        }}
        onFail={(error) => {
          console.error(error)
        }}
        userId={2}
      >
        <div>User Profile result here</div>
      </UserProfile>
    )
  }
}
```

# User Sleep

```jsx
import React, { Component } from 'react'

import { UserSleep } from 'whoop-integrator-react'
import 'whoop-integrator-react/dist/index.css'

class Example extends Component {
  render() {
    return (
      <UserSleep
        onSuccess={(result) => {
          console.log(result)
        }}
        onFail={(error) => {
          console.error(error)
        }}
        limit={25}
        offset={5}
        startTimeEpochMillisInclusive={pnew Date('2020-10-01').getTime()}
        endTimeEpochMillisExclusive={new Date().getTime()}
      >
        <div>User Sleep result here</div>
      </UserSleep>
    )
  }
}
```
# User Workout

```jsx
import React, { Component } from 'react'

import { UserWorkout } from 'whoop-integrator-react'
import 'whoop-integrator-react/dist/index.css'

class Example extends Component {
  render() {
    return (
      <UserWorkout
        onSuccess={(result) => {
          console.log(result)
        }}
        onFail={(error) => {
          console.error(error)
        }}
        limit={25}
      >
        <div>User Workout result here</div>
      </UserWorkout>
    )
  }
}
```

## License

MIT © [Cristofer Domingues](https://github.com/cristoferdomingues)