Skip to content

Commit 778ae71

Browse files
authored
Merge pull request #170 from phasehq/feat--improve-node-js-sdk-init
docs: clarify Node.js SDK docs
2 parents 6ec2a7d + a64323d commit 778ae71

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/pages/sdks/node.mdx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,25 @@ const Phase = require('@phase.dev/phase-node')
6666
Initialize the SDK with your `token`
6767

6868
```typescript
69-
const token = 'pss_service...'
69+
const token = 'pss_service...' // or process.env.PHASE_TOKEN
7070

7171
const phase = new Phase(token)
72+
73+
await phase.init()
7274
```
7375

7476
<Note>
7577
If you are self-hosting Phase, you must also provide the protocol and host for your Phase instance:
7678

7779
```typescript
78-
const token = 'pss_service...'
80+
const token = 'pss_service...' // or process.env.PHASE_TOKEN
7981
const host = 'https://console.phase.dev' // default
8082

8183
const phase = new Phase(token, host)
82-
```
83-
84-
</Note>
8584

86-
Then run `phase.init()` to initiate a session:
87-
88-
```typescript
8985
await phase.init()
9086
```
91-
92-
---
87+
</Note>
9388

9489
## Usage
9590

0 commit comments

Comments
 (0)