Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 30da76b

Browse files
authored
fix(docs): use open library instead of openBrowser function (#266)
1 parent 275d87e commit 30da76b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ See the [authenticating](https://www.netlify.com/docs/api/#authenticating) docs
163163

164164
```js
165165
// example:
166+
const open = require('open') // installed with 'npm i open'
167+
166168
const login = async () => {
167-
const ticket = await api.createTicket({
169+
const ticket = await client.createTicket({
168170
clientId: CLIENT_ID,
169171
})
170172
// Open browser for authentication
171-
await openBrowser(`https://app.netlify.com/authorize?response_type=ticket&ticket=${ticket.id}`)
172-
const accessToken = await api.getAccessToken(ticket)
173+
await open(`https://app.netlify.com/authorize?response_type=ticket&ticket=${ticket.id}`)
174+
const accessToken = await client.getAccessToken(ticket)
173175
// API is also set up to use the returned access token as a side effect
174176
return accessToken // Save this for later so you can quickly set up an authenticated client
175177
}

0 commit comments

Comments
 (0)