Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ yarn add orb-billing

The full API of this library can be found in [api.md](https://www.github.com/orbcorp/orb-node/blob/main/api.md).

<!-- prettier-ignore -->
```js
import Orb from 'orb-billing';

Expand All @@ -38,6 +39,7 @@ main();

This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:

<!-- prettier-ignore -->
```ts
import Orb from 'orb-billing';

Expand All @@ -61,6 +63,7 @@ When the library is unable to connect to the API,
or if the API returns a non-success status code (i.e., 4xx or 5xx response),
a subclass of `APIError` will be thrown:

<!-- prettier-ignore -->
```ts
async function main() {
const customer = await orb.customers
Expand Down Expand Up @@ -173,6 +176,7 @@ The "raw" `Response` returned by `fetch()` can be accessed through the `.asRespo

You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.

<!-- prettier-ignore -->
```ts
const orb = new Orb();

Expand All @@ -197,12 +201,11 @@ If you would prefer to use a global, web-standards-compliant `fetch` function ev
(for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
add the following import before your first import `from "Orb"`:

<!-- prettier-ignore -->
```ts
// Tell TypeScript and the package to use the global web fetch instead of node-fetch.
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
import "orb-billing/shims/web";
import Orb from "orb-billing";
import 'orb-billing/shims/web';
import Orb from 'orb-billing';
```

To do the inverse, add `import "orb-billing/shims/node"` (which does import polyfills).
Expand Down