Skip to content

Commit

Permalink
Add usage examples to README
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Mar 29, 2024
1 parent f2e6c4a commit 563b5fa
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,29 @@ $ npm install -D @seamapi/types@latest

## Usage

### Examples

_These examples assume `SEAM_API_KEY` is set in your environment._

#### List devices

```ts
import { SeamHttp } from '@seamapi/http/connect'

const seam = new SeamHttp('your-api-key')
const seam = new SeamHttp()
const devices = await seam.devices.list()
```

#### Unlock a door

```ts
import { SeamHttp } from '@seamapi/http/connect'

const seam = new SeamHttp()
const lock = await seam.locks.get({ name: 'Front Door' })
await seam.locks.unlockDoor({ device_id: lock.device_id })
```

### Authentication Methods

The SDK supports several authentication mechanisms.
Expand Down

0 comments on commit 563b5fa

Please sign in to comment.