Skip to content

Commit

Permalink
refactor: cleanup README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
117 committed Apr 2, 2024
1 parent 321eb56 commit 3964ded
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A TypeScript SDK for the https://alpaca.markets REST API and WebSocket streams.
- [Usage](#getting-started)
- [Create a Client](#create-a-client)
- [Configuration](#configuration)
- [Base URLs](#base-urls)
- [Environment Variables](#environment-variables)
- [Rate Limiting](#rate-limiting)
- [Methods](#methods)
- [Trading API](#trading-api)
Expand Down Expand Up @@ -77,12 +77,20 @@ const client = createClient({
});
```

You can also use the `ALPACA_KEY` and `ALPACA_SECRET` environment variables to set your API key and secret. The client will automatically use these values if they are set. They will not override any credentials explicitly passed to `createClient`.

> Note: By default, the client will make requests to the paper trading environment (`https://paper-api.alpaca.markets`). This is a safety measure to prevent accidental trades.
By default, the client will make requests to the paper trading environment (`https://paper-api.alpaca.markets`). This is a safety measure to prevent accidental trades.

### Configuration

#### Environment Variables

You can set the following environment variables to configure the client:

- `APCA_KEY_ID`: Your API key.
- `APCA_KEY_SECRET`: Your API secret.
- `APCA_ACCESS_TOKEN`: Your access token (if using OAuth).

The client will automatically use these values if they are set. They will not override any credentials explicitly passed to `createClient`.

#### Rate Limiting

You can customize the rate limiting by passing a `tokenBucket` object to the `createClient` function. This object should contain the `capacity` and `fillRate` for the rate limiter.
Expand Down

0 comments on commit 3964ded

Please sign in to comment.