@meistrari/data-token 0.0.2 → 0.0.3
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/README.md +5 -3
- package/dist/adapters/hono.d.ts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,10 +26,12 @@ import { Hono } from 'hono'
|
|
|
26
26
|
import { DataTokenContext, createDataTokenMiddleware } from '@meistrari/data-token/hono'
|
|
27
27
|
|
|
28
28
|
// Combine DataTokenContext with your own context type
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
type Env = {
|
|
30
|
+
Variables: {
|
|
31
|
+
customProp: string
|
|
32
|
+
}
|
|
31
33
|
}
|
|
32
|
-
type AppContext =
|
|
34
|
+
type AppContext = Env & DataTokenContext
|
|
33
35
|
|
|
34
36
|
const app = new Hono<AppContext>()
|
|
35
37
|
const dataToken = createDataTokenMiddleware('https://some.api.com/well-known/jwks.json')
|
package/dist/adapters/hono.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Context } from 'hono';
|
|
2
2
|
import type { DataToken } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export type DataTokenContext = {
|
|
4
4
|
Variables: {
|
|
5
5
|
authData?: DataToken;
|
|
6
6
|
};
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
/**
|
|
9
9
|
* Create a data token middleware for Hono
|
|
10
10
|
* @param url - The URL of the JWKS endpoint
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED