Skip to content

Commit

Permalink
Fix README examples (#244)
Browse files Browse the repository at this point in the history
* Fix README examples

* prettier
  • Loading branch information
logan-stytch authored Aug 9, 2023
1 parent a8366ed commit 43732f4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const stytch = require("stytch");
const client = new stytch.Client({
project_id: "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317",
secret: "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=",
env: stytch.envs.test,
});
```

Expand All @@ -83,7 +82,7 @@ Authenticate the token from the magic link:

```javascript
client.magicLinks
.authenticate("DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=")
.authenticate({ token: "DOYoip3rvIMMW5lgItikFK-Ak1CfMsgjuiCyI7uuU94=" })
.then((res) => console.log(res))
.catch((err) => console.error(err));
```
Expand All @@ -100,7 +99,6 @@ const stytch = require("stytch");
const client = new stytch.B2BClient({
project_id: "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317",
secret: "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=",
env: stytch.envs.test,
});
```

Expand Down Expand Up @@ -143,7 +141,7 @@ Stytch errors always include an `error_type` field you can use to identify them:

```javascript
client.magicLinks
.authenticate("not-a-token!")
.authenticate({ token: "not-a-token!" })
.then((res) => console.log(res))
.catch((err) => {
if (err.error_type === "invalid_token") {
Expand All @@ -167,7 +165,6 @@ const agent = new https.Agent({
const client = new stytch.Client({
project_id: "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317",
secret: "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=",
env: stytch.envs.test,
agent,
});
```
Expand Down

0 comments on commit 43732f4

Please sign in to comment.