Skip to content

Commit 563b5fa

Browse files
committed
Add usage examples to README
1 parent f2e6c4a commit 563b5fa

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,29 @@ $ npm install -D @seamapi/types@latest
7474

7575
## Usage
7676

77+
### Examples
78+
79+
_These examples assume `SEAM_API_KEY` is set in your environment._
80+
81+
#### List devices
82+
7783
```ts
7884
import { SeamHttp } from '@seamapi/http/connect'
7985

80-
const seam = new SeamHttp('your-api-key')
86+
const seam = new SeamHttp()
8187
const devices = await seam.devices.list()
8288
```
8389

90+
#### Unlock a door
91+
92+
```ts
93+
import { SeamHttp } from '@seamapi/http/connect'
94+
95+
const seam = new SeamHttp()
96+
const lock = await seam.locks.get({ name: 'Front Door' })
97+
await seam.locks.unlockDoor({ device_id: lock.device_id })
98+
```
99+
84100
### Authentication Methods
85101

86102
The SDK supports several authentication mechanisms.

0 commit comments

Comments
 (0)