Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into max/node-client-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
max-stytch committed Oct 4, 2023
2 parents 3be46f0 + fd68024 commit 145933b
Show file tree
Hide file tree
Showing 73 changed files with 4,971 additions and 5,212 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-node@v3
with:
registry-url: "https://registry.npmjs.org"
node-version: "16"
node-version: "18"

- name: Install
run: npm install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "18"
- run: npm install
- run: npm run lint

Expand All @@ -23,6 +23,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "18"
- run: npm install
- run: npm run check-format
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [16, 18, 20]
version: [18, 20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
Expand All @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [16, 18, 20]
version: [18, 20]
environment: integration_tests
steps:
- uses: actions/checkout@v3
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: "16"
node-version: "18"
- run: npm ci
- run: npm run build
- run: git diff --exit-code
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Stytch Node library makes it easy to use the Stytch user infrastructure API

It pairs well with the Stytch [Web SDK](https://www.npmjs.com/package/@stytch/stytch-js) or your own custom authentication flow.

This library is tested with all current LTS versions of Node - **16**, **18**, and **20**.
This library is tested with all current LTS versions of Node - **18**, and **20**.

## Install

Expand Down Expand Up @@ -154,18 +154,19 @@ Learn more about errors in the [docs](https://stytch.com/docs/api/errors).

## Customizing the HTTPS Agent

The Stytch client can be customized to use your own HTTPS agent.
The Stytch client uses [undici](https://github.com/nodejs/undici), the Node fetch implementation. You can pass a custom undici `Dispatcher` to the client for use in requests.
For example, you can enable HTTPS Keep-Alive to avoid the cost of establishing a new connection with the Stytch servers on every request.

```javascript
const agent = new https.Agent({
keepAlive: true,
const dispatcher = new undici.Agent({
keepAliveTimeout: 6e6, // 10 minutes in MS
keepAliveMaxTimeout: 6e6, // 10 minutes in MS
});

const client = new stytch.Client({
project_id: "project-live-c60c0abe-c25a-4472-a9ed-320c6667d317",
secret: "secret-live-80JASucyk7z_G8Z-7dVwZVGXL5NT_qGAQ2I=",
agent,
dispatcher,
});
```

Expand Down
2 changes: 1 addition & 1 deletion babel.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
["@babel/preset-env", { "modules": "commonjs" }],
"@babel/preset-typescript"
],
"targets": "node 16",
"targets": "node 18",
"ignore": ["**/__mocks__/**"]
}
16 changes: 0 additions & 16 deletions dist/b2b/client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions dist/b2b/discovery.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions dist/b2b/discovery_intermediate_sessions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions dist/b2b/discovery_organizations.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions dist/b2b/magic_links.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions dist/b2b/magic_links_discovery.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 145933b

Please sign in to comment.