Skip to content

Commit 0f4d0a8

Browse files
committed
docs: add env var usage example to README
1 parent 97927df commit 0f4d0a8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ Or install it yourself as:
2222
```ruby
2323
require 'switchbot'
2424

25+
# pass token and secret directly
2526
client = Switchbot::Client.new('YOUR_TOKEN', 'YOUR_SECRET')
27+
28+
# or use environment variables
29+
ENV['SWITCHBOT_API_TOKEN'] = 'YOUR_TOKEN'
30+
ENV['SWITCHBOT_API_SECRET'] = 'YOUR_SECRET'
31+
client = Switchbot::Client.new
2632
```
2733

2834
For v0.6.0 and below, refer to [README-v0.6.0-and-below.md](https://github.com/ytkg/switchbot/blob/main/README-v0.6.0-and-below.md).

0 commit comments

Comments
 (0)