kinde-testkit 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2
4
+
5
+ - Show the README diagrams as images, so they display on npm as well as GitHub.
6
+
3
7
  ## 0.2.1
4
8
 
5
9
  - Add CI on GitHub Actions: typecheck, tests and build on Node 22 and 24, a runtime check of the built package on Node 20, and the Next.js example's browser tests.
package/README.md CHANGED
@@ -22,25 +22,7 @@ The last group is hard to produce against a real Kinde tenant at all. These are
22
22
 
23
23
  ## How it works
24
24
 
25
- ```mermaid
26
- flowchart LR
27
- subgraph tests[Your test suite]
28
- S["scenario()<br/>admin, viewer, other org,<br/>expired, unsigned..."]
29
- end
30
- subgraph kit[kinde-testkit on localhost]
31
- K[Test signing key]
32
- D["/.well-known/openid-configuration"]
33
- J["/.well-known/jwks"]
34
- end
35
- subgraph app[Your app, unchanged]
36
- M[JWT middleware]
37
- R[Routes and permission checks]
38
- end
39
- S -- "tokenFor(scenario)" --> K
40
- K -- "Bearer token" --> M
41
- M -- "fetch keys" --> J
42
- M --> R
43
- ```
25
+ ![Your tests ask kinde-testkit for a token, your app checks it against the testkit's JWKS, and your routes answer 200, 401 or 403](https://raw.githubusercontent.com/sholajegede/kinde-testkit/main/docs/how-it-works.png)
44
26
 
45
27
  1. You describe who is calling with `scenario()`.
46
28
  2. kinde-testkit signs an RS256 access token for that scenario with a key that exists only on your machine.
@@ -51,19 +33,7 @@ Nothing is mocked inside your app. If the middleware forgets to check the audien
51
33
 
52
34
  Browser sign-in follows the same flow your app uses with Kinde:
53
35
 
54
- ```mermaid
55
- sequenceDiagram
56
- participant T as Playwright test
57
- participant A as Your app (Kinde SDK)
58
- participant K as kinde-testkit
59
- T->>A: open /api/auth/login
60
- A->>K: redirect to /oauth2/auth
61
- T->>K: pick admin@example.test
62
- K->>A: redirect to callback with a code
63
- A->>K: POST /oauth2/token (code)
64
- K->>A: access, ID and refresh tokens
65
- A->>T: signed-in page
66
- ```
36
+ ![A Playwright test opens the app's login route, picks a user on the kinde-testkit sign-in page, and the app exchanges the code for tokens](https://raw.githubusercontent.com/sholajegede/kinde-testkit/main/docs/sign-in-flow.png)
67
37
 
68
38
  ## Install
69
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kinde-testkit",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Test Kinde-authenticated apps offline: a local issuer with a real sign-in flow, Kinde-shaped tokens, reusable auth scenarios, and Vitest and Playwright helpers.",
5
5
  "license": "MIT",
6
6
  "author": "Shola Jegede <jegedeshola@gmail.com>",