@lit-protocol/vincent-app-sdk 1.0.3-beta.7 → 2.0.1

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,3 +1,196 @@
1
+ ## 2.0.1 (2025-09-03)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated ability-sdk to 2.0.1
6
+ - Updated contracts-sdk to 1.1.0
7
+
8
+ # 2.0.0 (2025-08-05)
9
+
10
+ ### 🚀 Features
11
+
12
+ - Bug fix in app-sdk that kept a policy's allow result from being returned ([11325427](https://github.com/LIT-Protocol/Vincent/commit/11325427))
13
+ - ### Implement supported Vincent Ability API range ([14f0ece1](https://github.com/LIT-Protocol/Vincent/commit/14f0ece1))
14
+
15
+ Added basic Ability API handling to ensure abilities & policies are only used by compatible abilities and policies, and with the correct version of the vincentAbilityClient / app-sdk
16
+
17
+ - Added a new jsParam when VincentAbilityClient calls an ability, `vincentAbilityApiVersion`
18
+ - LIT action wrappers for abilities + policies compare `vincentAbilityApiVersion` to match the major semver range the handler was built with from the ability-sdk
19
+ - vincentAbilityHandler() is responsible for passing along the value when it evaluates supported policies
20
+
21
+ ### 🩹 Fixes
22
+
23
+ - ### Fix ability failure response cases ([e2be50d9](https://github.com/LIT-Protocol/Vincent/commit/e2be50d9))
24
+
25
+ - Ensures that policy denial disables checking the ability result against its fail schema in the abilityClient, because it will always be undefined :)
26
+ - Ensures that `context` is returned in the response from the abilityClient.execute() method in cases where the ability response was a runtime or schemaValidationError
27
+
28
+ ### ⚠️ Breaking Changes
29
+
30
+ - Add support for CBOR2 encoded policy parameters using the new vincent-contracts-sdk ([868c6c2a](https://github.com/LIT-Protocol/Vincent/commit/868c6c2a))
31
+ - ### Add support for explicit `schemaValidationError` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
32
+
33
+ - Previously, a failure to validate either input or results of lifecycle method would result in `result: { zodError }` being returned
34
+ - Now, `result` will be `undefined` and there will be an explicit `schemaValidationError` in the result of the ability / policy
35
+
36
+ ```typescript
37
+ export interface SchemaValidationError {
38
+ zodError: ZodError<unknown>; // The result of `zod.safeParse().error`
39
+ phase: string; // Policies: `precheck`|`evaluate`|`commit` - Abilities: `precheck` | `execute`
40
+ stage: string; // `input` | `output`
41
+ }
42
+ ```
43
+
44
+ - ### `error` is now `runtimeError` and can only be set by `throw ...` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
45
+
46
+ - Previously, if you had not defined a `deny` or `fail` schema, you could call `deny()` or `fail()` with a string
47
+ - That string would end up in the ability/policy response as the `error` property instead of `result`
48
+ - This was problematic because there was no consistent way to identify _un-handled_ error vs. _explicitly returned fail/deny results_
49
+ - If you don't define a deny or fail schema, you can no longer call those methods with a string.
50
+ - `error` is now `runtimeError`, and is _only_ set if a lifecycle method `throw`s an Error - in that case it will be the `message` property of the error
51
+ - If you want to be able to return simple errors in your _result_, you can define a simple deny or fail schema like `z.object({ error: z.string() }`
52
+
53
+ - ### Create vincentAbilityClient namespace ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
54
+
55
+ Previously, `getVincentAbilityClient()` and `disconnectVincentAbilityClients()` were exported from the root of the `vincent-app-sdk` package.
56
+ These methods, along with several other methods are now exported from the `@lit-protocol/app-sdk/abilityClient` namespace
57
+
58
+ ```typescript
59
+ import {
60
+ getVincentAbilityClient,
61
+ disconnectVincentAbilityClients,
62
+ isAbilityResponseFailure,
63
+ isAbilityResponseRuntimeFailure,
64
+ isAbilityResponseSchemaValidationFailure,
65
+ isAbilityResponseSuccess,
66
+ } from '@lit-protocol/app-sdk/abilityClient';
67
+ ```
68
+
69
+ - #### Standardized `app` property on on JWT payload to be a number instead of a string. ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
70
+ - #### Renamed `consent page` to `delegation auth page` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
71
+ - #### Move utils exports to `@lit-protocol/vincent-app-sdk/utils` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
72
+ - #### Moved jwt exports to `@lit-protocol/vincent-app-sdk/jwt` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
73
+
74
+ - Enhanced typedocs for all methods and removed type aliases for core functions
75
+
76
+ - #### Move `VincentWebAppClient` exports to `@lit-protocol/vincent-app-sdk/webAppClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
77
+
78
+ - Renamed `VincentWebAppClient` to `WebAuthClient`
79
+ - Renamed `VincentAppClientConfig` to `WebAuthClientConfig`
80
+ - Renamed `RedirectToVincentConsentPageParams` to `RedirectToVincentDelegationPageParams`
81
+ - Renamed `redirectToConsentPage()` to `redirectToDelegationAuthPage()`
82
+ - Renamed `getVincentWebAppClient()` to `getWebAuthClient()`
83
+
84
+ - #### Move express-authentication-middleware exports to `@lit-protocol/vincent-app-sdk/expressMiddleware` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
85
+
86
+ - Removed `ExpressAuthHelpers` interface - its types are now directly exported from the `expressMiddleware` package sub-path
87
+
88
+ - #### Moved abilityClient exports to `@lit-protocol/vincent-app-sdk/abilityClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
89
+ - ### Update express middleware to support non-app-specific JWTs ([9dd1cd26](https://github.com/LIT-Protocol/Vincent/commit/9dd1cd26))
90
+
91
+ - Replaced individual function exports of `authenticatedRequestHandler()` and `getAuthenticateUserExpressHandler()` with a single `createVincentUserMiddleware()` function
92
+
93
+ #### createVincentUserMiddleware({ allowedAudience, userKey, requiredAppId? }) -> { middleware(), handler() }
94
+
95
+ - You can now configure the property on `req` where the vincent user JWT data will be placed using `userKey`
96
+ - You can now configure the authentication middleware to throw if `requiredAppId` does not match a specific appId you provide
97
+ - `allowedAudience` behaviour remains unchanged
98
+ - See example usage on the API docs for the package @ http://docs.heyvincent.ai
99
+
100
+ ```
101
+
102
+ ```
103
+
104
+ - ### Support JWTs that are not app-specific ([0553a934](https://github.com/LIT-Protocol/Vincent/commit/0553a934))
105
+
106
+ This release adds support for general authentication JWTs that are not tied to a specific app. This is a breaking change that requires updates to code that uses the JWT validation functions.
107
+
108
+ #### API Changes
109
+
110
+ - `verify` and `decode` functions now accept object parameters instead of separate parameters
111
+ - Their return values are strongly typed based on whether `requiredAppId` is provided.
112
+ - They throw if `requiredAppId` is provided but the jwt is either not app-specific or the app id on the token doesn't match the `requiredAppId`
113
+ - `appId` type changed from `string` to `number` in WebAuthClient configuration
114
+ - WebAuthClient now throws an error if the `appId` it was configured with isn't in the JWT it decodes
115
+
116
+ #### New Functions
117
+
118
+ - `isGeneralJWT`: Type guard to check if a JWT is Vincent JWT that has no app associated
119
+ - `isAppSpecificJWT`: Type guard to check if a JWT is a vincent JWT that is app-specific
120
+ - `assertIsVincentJWT`: Assertion function to validate if a decoded JWT is a valid Vincent JWT
121
+ - `getAppInfo`: Convenience method that returns the app ID and version from an app-specific JWT's payload
122
+ - `getPKPInfo`: Convenience method that returns PKP information from any Vincent JWT's payload
123
+
124
+ #### New Types
125
+
126
+ - `VincentJWT`: Interface for a decoded Vincent JWT without app-specific details (general authentication)
127
+ - `VincentJWTAppSpecific`: Interface for a decoded app-specific Vincent JWT
128
+ - `BaseVincentJWTPayload`: Payload that contains always-present properties on all Vincent JWTs
129
+ - `VincentAppSpecificJWTPayload`: Extends VincentJWTPayload with app-specific information
130
+
131
+ - ## JWT Refactor ([c21bc3c3](https://github.com/LIT-Protocol/Vincent/commit/c21bc3c3))
132
+
133
+ #### Refactored our JWT structure, composition, and verification logic.
134
+
135
+ - Removed dependency on `did-jwt`; since we are signing using EIP-191 compliant signatures, the presence of `did:ethr` was misleading.
136
+ - Added support for Delegatee JWTs
137
+
138
+ #### We now support 3 types of JWT:
139
+
140
+ - `VincentJWTAppUser`
141
+ - `role` claim in the JWT payload is `app-user`
142
+ - Contains PKP info
143
+ - Is app-specific
144
+ - Is provided to app end-users, so that they can authenticate with services that are provided by individual Vincent Apps
145
+ - `VincentJWTPlatformUser`
146
+ - `role` claim in the JWT payload is `platform-user`
147
+ - Contains PKP info
148
+ - Used to authenticate with Vincent platform services (e.g. the registry backend)
149
+ - Is not app-specific
150
+ - The Vincent dashboard uses these for App owners and Ability & Policy authors
151
+ - `VincentJWTDelegatee`
152
+ - `role` claim in the JWT payload is `app-delegatee`
153
+ - Does not contain PKP info; delegatees are not PKP-backed
154
+ - Is not app-specific
155
+ - Used to authenticate with services that require proof that they are being used by a specific delegatee who has permissions to act on behalf of a delegator (app user) account.
156
+
157
+ ### API Changes
158
+
159
+ - Many classes and interfaces were renamed to clearly indicate which type of JWT that they apply to.
160
+ - Added `publicKey` to the `payload` of all JWTs for signature verification convenience
161
+ - `iss` and `sub` are now raw hex-formatted ethers addresses, without `did:ethr` prefixes
162
+ - JWT verification has been converted to be an async process, and explicit verify methods have been defined for each type of JWT
163
+ - `verifyVincentAppUserJWT()`
164
+ - `verifyVincentPlatformJWT()`
165
+ - `verifyVincentDelegateeJWT()`
166
+ - Type-guard functions have also been added to help identify the kind of JWT you are using and provide type-safe references to those JWTs, but for most use-cases you will probably just use the type-specific `verify` methods.
167
+ - `isVincentJWTAppSpecific()`
168
+ - `isVincentPlatformJWT()`
169
+ - `isVincentJWTDelegatee()`
170
+ - `isAnyVincentJWT()`
171
+ - Added accessor helper functions to facilitate easy, type-safe access to properties on supported JWTs
172
+ - `getRole()` - All Vincent JWTs
173
+ - `getPublicKey()` - All Vincent JWTs
174
+ - `getIssuerAddress()` - All Vincent JWTs
175
+ - `getAudience()` - All Vincent JWTs
176
+ - `getSubjectAddress()` - Only for `VincentJWTDelegatee`
177
+ - `getAppInfo()` - Only for `VincentJWTAppUser`
178
+ - `getPKPInfo()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
179
+ - `getAuthentication()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
180
+ - `decode` has been renamed to `decodeVincentJWT()`;
181
+ - You probably want to use the type-specific `verify` methods instead of calling decode directly, unless you're absolutely sure that you've already verified the JWT and are positive it hasn't expired!
182
+ - This function returns an `AnyVincentJWT` type which you must narrow using type-guard functions.
183
+
184
+ ### 🧱 Updated Dependencies
185
+
186
+ - Updated ability-sdk to 2.0.0
187
+ - Updated contracts-sdk to 2.0.0
188
+
189
+ ### ❤️ Thank You
190
+
191
+ - Daryl Collins
192
+ - Wyatt Barnes @spacesailor24
193
+
1
194
  ## 1.0.2 (2025-07-08)
2
195
 
3
196
  ### 🩹 Fixes
package/dist/CHANGELOG.md CHANGED
@@ -1,3 +1,196 @@
1
+ ## 2.0.1 (2025-09-03)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated ability-sdk to 2.0.1
6
+ - Updated contracts-sdk to 1.1.0
7
+
8
+ # 2.0.0 (2025-08-05)
9
+
10
+ ### 🚀 Features
11
+
12
+ - Bug fix in app-sdk that kept a policy's allow result from being returned ([11325427](https://github.com/LIT-Protocol/Vincent/commit/11325427))
13
+ - ### Implement supported Vincent Ability API range ([14f0ece1](https://github.com/LIT-Protocol/Vincent/commit/14f0ece1))
14
+
15
+ Added basic Ability API handling to ensure abilities & policies are only used by compatible abilities and policies, and with the correct version of the vincentAbilityClient / app-sdk
16
+
17
+ - Added a new jsParam when VincentAbilityClient calls an ability, `vincentAbilityApiVersion`
18
+ - LIT action wrappers for abilities + policies compare `vincentAbilityApiVersion` to match the major semver range the handler was built with from the ability-sdk
19
+ - vincentAbilityHandler() is responsible for passing along the value when it evaluates supported policies
20
+
21
+ ### 🩹 Fixes
22
+
23
+ - ### Fix ability failure response cases ([e2be50d9](https://github.com/LIT-Protocol/Vincent/commit/e2be50d9))
24
+
25
+ - Ensures that policy denial disables checking the ability result against its fail schema in the abilityClient, because it will always be undefined :)
26
+ - Ensures that `context` is returned in the response from the abilityClient.execute() method in cases where the ability response was a runtime or schemaValidationError
27
+
28
+ ### ⚠️ Breaking Changes
29
+
30
+ - Add support for CBOR2 encoded policy parameters using the new vincent-contracts-sdk ([868c6c2a](https://github.com/LIT-Protocol/Vincent/commit/868c6c2a))
31
+ - ### Add support for explicit `schemaValidationError` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
32
+
33
+ - Previously, a failure to validate either input or results of lifecycle method would result in `result: { zodError }` being returned
34
+ - Now, `result` will be `undefined` and there will be an explicit `schemaValidationError` in the result of the ability / policy
35
+
36
+ ```typescript
37
+ export interface SchemaValidationError {
38
+ zodError: ZodError<unknown>; // The result of `zod.safeParse().error`
39
+ phase: string; // Policies: `precheck`|`evaluate`|`commit` - Abilities: `precheck` | `execute`
40
+ stage: string; // `input` | `output`
41
+ }
42
+ ```
43
+
44
+ - ### `error` is now `runtimeError` and can only be set by `throw ...` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
45
+
46
+ - Previously, if you had not defined a `deny` or `fail` schema, you could call `deny()` or `fail()` with a string
47
+ - That string would end up in the ability/policy response as the `error` property instead of `result`
48
+ - This was problematic because there was no consistent way to identify _un-handled_ error vs. _explicitly returned fail/deny results_
49
+ - If you don't define a deny or fail schema, you can no longer call those methods with a string.
50
+ - `error` is now `runtimeError`, and is _only_ set if a lifecycle method `throw`s an Error - in that case it will be the `message` property of the error
51
+ - If you want to be able to return simple errors in your _result_, you can define a simple deny or fail schema like `z.object({ error: z.string() }`
52
+
53
+ - ### Create vincentAbilityClient namespace ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
54
+
55
+ Previously, `getVincentAbilityClient()` and `disconnectVincentAbilityClients()` were exported from the root of the `vincent-app-sdk` package.
56
+ These methods, along with several other methods are now exported from the `@lit-protocol/app-sdk/abilityClient` namespace
57
+
58
+ ```typescript
59
+ import {
60
+ getVincentAbilityClient,
61
+ disconnectVincentAbilityClients,
62
+ isAbilityResponseFailure,
63
+ isAbilityResponseRuntimeFailure,
64
+ isAbilityResponseSchemaValidationFailure,
65
+ isAbilityResponseSuccess,
66
+ } from '@lit-protocol/app-sdk/abilityClient';
67
+ ```
68
+
69
+ - #### Standardized `app` property on on JWT payload to be a number instead of a string. ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
70
+ - #### Renamed `consent page` to `delegation auth page` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
71
+ - #### Move utils exports to `@lit-protocol/vincent-app-sdk/utils` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
72
+ - #### Moved jwt exports to `@lit-protocol/vincent-app-sdk/jwt` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
73
+
74
+ - Enhanced typedocs for all methods and removed type aliases for core functions
75
+
76
+ - #### Move `VincentWebAppClient` exports to `@lit-protocol/vincent-app-sdk/webAppClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
77
+
78
+ - Renamed `VincentWebAppClient` to `WebAuthClient`
79
+ - Renamed `VincentAppClientConfig` to `WebAuthClientConfig`
80
+ - Renamed `RedirectToVincentConsentPageParams` to `RedirectToVincentDelegationPageParams`
81
+ - Renamed `redirectToConsentPage()` to `redirectToDelegationAuthPage()`
82
+ - Renamed `getVincentWebAppClient()` to `getWebAuthClient()`
83
+
84
+ - #### Move express-authentication-middleware exports to `@lit-protocol/vincent-app-sdk/expressMiddleware` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
85
+
86
+ - Removed `ExpressAuthHelpers` interface - its types are now directly exported from the `expressMiddleware` package sub-path
87
+
88
+ - #### Moved abilityClient exports to `@lit-protocol/vincent-app-sdk/abilityClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
89
+ - ### Update express middleware to support non-app-specific JWTs ([9dd1cd26](https://github.com/LIT-Protocol/Vincent/commit/9dd1cd26))
90
+
91
+ - Replaced individual function exports of `authenticatedRequestHandler()` and `getAuthenticateUserExpressHandler()` with a single `createVincentUserMiddleware()` function
92
+
93
+ #### createVincentUserMiddleware({ allowedAudience, userKey, requiredAppId? }) -> { middleware(), handler() }
94
+
95
+ - You can now configure the property on `req` where the vincent user JWT data will be placed using `userKey`
96
+ - You can now configure the authentication middleware to throw if `requiredAppId` does not match a specific appId you provide
97
+ - `allowedAudience` behaviour remains unchanged
98
+ - See example usage on the API docs for the package @ http://docs.heyvincent.ai
99
+
100
+ ```
101
+
102
+ ```
103
+
104
+ - ### Support JWTs that are not app-specific ([0553a934](https://github.com/LIT-Protocol/Vincent/commit/0553a934))
105
+
106
+ This release adds support for general authentication JWTs that are not tied to a specific app. This is a breaking change that requires updates to code that uses the JWT validation functions.
107
+
108
+ #### API Changes
109
+
110
+ - `verify` and `decode` functions now accept object parameters instead of separate parameters
111
+ - Their return values are strongly typed based on whether `requiredAppId` is provided.
112
+ - They throw if `requiredAppId` is provided but the jwt is either not app-specific or the app id on the token doesn't match the `requiredAppId`
113
+ - `appId` type changed from `string` to `number` in WebAuthClient configuration
114
+ - WebAuthClient now throws an error if the `appId` it was configured with isn't in the JWT it decodes
115
+
116
+ #### New Functions
117
+
118
+ - `isGeneralJWT`: Type guard to check if a JWT is Vincent JWT that has no app associated
119
+ - `isAppSpecificJWT`: Type guard to check if a JWT is a vincent JWT that is app-specific
120
+ - `assertIsVincentJWT`: Assertion function to validate if a decoded JWT is a valid Vincent JWT
121
+ - `getAppInfo`: Convenience method that returns the app ID and version from an app-specific JWT's payload
122
+ - `getPKPInfo`: Convenience method that returns PKP information from any Vincent JWT's payload
123
+
124
+ #### New Types
125
+
126
+ - `VincentJWT`: Interface for a decoded Vincent JWT without app-specific details (general authentication)
127
+ - `VincentJWTAppSpecific`: Interface for a decoded app-specific Vincent JWT
128
+ - `BaseVincentJWTPayload`: Payload that contains always-present properties on all Vincent JWTs
129
+ - `VincentAppSpecificJWTPayload`: Extends VincentJWTPayload with app-specific information
130
+
131
+ - ## JWT Refactor ([c21bc3c3](https://github.com/LIT-Protocol/Vincent/commit/c21bc3c3))
132
+
133
+ #### Refactored our JWT structure, composition, and verification logic.
134
+
135
+ - Removed dependency on `did-jwt`; since we are signing using EIP-191 compliant signatures, the presence of `did:ethr` was misleading.
136
+ - Added support for Delegatee JWTs
137
+
138
+ #### We now support 3 types of JWT:
139
+
140
+ - `VincentJWTAppUser`
141
+ - `role` claim in the JWT payload is `app-user`
142
+ - Contains PKP info
143
+ - Is app-specific
144
+ - Is provided to app end-users, so that they can authenticate with services that are provided by individual Vincent Apps
145
+ - `VincentJWTPlatformUser`
146
+ - `role` claim in the JWT payload is `platform-user`
147
+ - Contains PKP info
148
+ - Used to authenticate with Vincent platform services (e.g. the registry backend)
149
+ - Is not app-specific
150
+ - The Vincent dashboard uses these for App owners and Ability & Policy authors
151
+ - `VincentJWTDelegatee`
152
+ - `role` claim in the JWT payload is `app-delegatee`
153
+ - Does not contain PKP info; delegatees are not PKP-backed
154
+ - Is not app-specific
155
+ - Used to authenticate with services that require proof that they are being used by a specific delegatee who has permissions to act on behalf of a delegator (app user) account.
156
+
157
+ ### API Changes
158
+
159
+ - Many classes and interfaces were renamed to clearly indicate which type of JWT that they apply to.
160
+ - Added `publicKey` to the `payload` of all JWTs for signature verification convenience
161
+ - `iss` and `sub` are now raw hex-formatted ethers addresses, without `did:ethr` prefixes
162
+ - JWT verification has been converted to be an async process, and explicit verify methods have been defined for each type of JWT
163
+ - `verifyVincentAppUserJWT()`
164
+ - `verifyVincentPlatformJWT()`
165
+ - `verifyVincentDelegateeJWT()`
166
+ - Type-guard functions have also been added to help identify the kind of JWT you are using and provide type-safe references to those JWTs, but for most use-cases you will probably just use the type-specific `verify` methods.
167
+ - `isVincentJWTAppSpecific()`
168
+ - `isVincentPlatformJWT()`
169
+ - `isVincentJWTDelegatee()`
170
+ - `isAnyVincentJWT()`
171
+ - Added accessor helper functions to facilitate easy, type-safe access to properties on supported JWTs
172
+ - `getRole()` - All Vincent JWTs
173
+ - `getPublicKey()` - All Vincent JWTs
174
+ - `getIssuerAddress()` - All Vincent JWTs
175
+ - `getAudience()` - All Vincent JWTs
176
+ - `getSubjectAddress()` - Only for `VincentJWTDelegatee`
177
+ - `getAppInfo()` - Only for `VincentJWTAppUser`
178
+ - `getPKPInfo()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
179
+ - `getAuthentication()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
180
+ - `decode` has been renamed to `decodeVincentJWT()`;
181
+ - You probably want to use the type-specific `verify` methods instead of calling decode directly, unless you're absolutely sure that you've already verified the JWT and are positive it hasn't expired!
182
+ - This function returns an `AnyVincentJWT` type which you must narrow using type-guard functions.
183
+
184
+ ### 🧱 Updated Dependencies
185
+
186
+ - Updated ability-sdk to 2.0.0
187
+ - Updated contracts-sdk to 2.0.0
188
+
189
+ ### ❤️ Thank You
190
+
191
+ - Daryl Collins
192
+ - Wyatt Barnes @spacesailor24
193
+
1
194
  ## 1.0.2 (2025-07-08)
2
195
 
3
196
  ### 🩹 Fixes
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-app-sdk",
3
- "version": "1.0.3-beta.6",
3
+ "version": "2.0.1",
4
4
  "description": "Vincent SDK for browser and backend",
5
5
  "author": "Lit Protocol",
6
6
  "license": "ISC",
@@ -52,10 +52,10 @@
52
52
  "typecheck": "./scripts/precommit-check.sh"
53
53
  },
54
54
  "dependencies": {
55
- "@lit-protocol/auth-helpers": "^7.0.9",
56
- "@lit-protocol/constants": "^7.0.8",
57
- "@lit-protocol/lit-node-client": "^7.0.8",
58
- "@lit-protocol/vincent-ability-sdk": "0.0.7-mma",
55
+ "@lit-protocol/auth-helpers": "^7.2.3",
56
+ "@lit-protocol/constants": "^7.2.3",
57
+ "@lit-protocol/lit-node-client": "^7.2.3",
58
+ "@lit-protocol/vincent-ability-sdk": "workspace:*",
59
59
  "@lit-protocol/vincent-contracts-sdk": "workspace:*",
60
60
  "@noble/secp256k1": "^2.2.3",
61
61
  "ethers": "5.8.0",
@@ -68,8 +68,8 @@
68
68
  "*.md"
69
69
  ],
70
70
  "devDependencies": {
71
- "@lit-protocol/pkp-ethers": "^7.2.0",
72
- "@lit-protocol/types": "^7.0.8",
71
+ "@lit-protocol/pkp-ethers": "^7.2.3",
72
+ "@lit-protocol/types": "^7.2.3",
73
73
  "@types/express": "^5.0.1",
74
74
  "chokidar-cli": "^3.0.0",
75
75
  "live-server": "^1.2.2",
@@ -11,8 +11,7 @@ export declare function createAppUserJWT(config: CreateAppUserJWTParams): Promis
11
11
  /**
12
12
  * Creates a JWT for an app delegatee (Ethereum account that may act on behalf of a user).
13
13
  *
14
- * If your use-case is to authenticate with a service on behalf of a specific delegator, you must provide a valid `subjectAddress`
15
- * which should be a valid delegator for your Delegatee address.
14
+ * You must provide a valid `subjectAddress`, which must be a valid delegator for your Delegatee address.
16
15
  *
17
16
  * @category API > Create
18
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/jwt/core/create.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAG5B,MAAM,UAAU,CAAC;AAgDlB;;;KAGK;AACL,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAYhG;AAED;;KAEK;AACL,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBtF;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ1F"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/jwt/core/create.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAI5B,MAAM,UAAU,CAAC;AAuDlB;;;KAGK;AACL,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAYhG;AAED;;KAEK;AACL,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBtF;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ1F"}
@@ -6,6 +6,7 @@ exports.createDelegateeJWT = createDelegateeJWT;
6
6
  const utils_1 = require("ethers/lib/utils");
7
7
  const constants_1 = require("../constants");
8
8
  const base64_1 = require("./utils/base64");
9
+ const ensureHex = (s) => (0, utils_1.hexlify)(s, { allowMissingPrefix: true });
9
10
  function createES256KSigner(wallet) {
10
11
  return async (data) => {
11
12
  const messageBytes = typeof data === 'string' ? (0, utils_1.toUtf8Bytes)(data) : data;
@@ -22,12 +23,14 @@ async function createJWS({ payload, wallet, config }) {
22
23
  const iat = Math.floor(Date.now() / 1000);
23
24
  const exp = (payload.nbf || Math.floor(Date.now() / 1000) + expiresInMinutes * 60);
24
25
  const header = { alg: 'ES256K', typ: 'JWT' };
26
+ const iss = ensureHex(await wallet.getAddress());
27
+ const publicKey = ensureHex(wallet.publicKey);
25
28
  const _payload = {
26
29
  ...payload,
27
30
  iat,
28
31
  exp,
29
- iss: await wallet.getAddress(),
30
- publicKey: wallet.publicKey,
32
+ iss,
33
+ publicKey,
31
34
  aud: audience,
32
35
  role,
33
36
  ...(subjectAddress ? { sub: subjectAddress } : {}),
@@ -77,8 +80,7 @@ async function createAppUserJWT(config) {
77
80
  /**
78
81
  * Creates a JWT for an app delegatee (Ethereum account that may act on behalf of a user).
79
82
  *
80
- * If your use-case is to authenticate with a service on behalf of a specific delegator, you must provide a valid `subjectAddress`
81
- * which should be a valid delegator for your Delegatee address.
83
+ * You must provide a valid `subjectAddress`, which must be a valid delegator for your Delegatee address.
82
84
  *
83
85
  * @category API > Create
84
86
  */
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/jwt/core/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OAAO,SAAS,CAAC;QACf,OAAO,EAAE;YACP,GAAG,OAAO;YACV,OAAO;YACP,GAAG;YACH,cAAc;SACf;QACD,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE;KACzD,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,kBAAkB,CAAC,MAAgC;IACvE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAE1F,OAAO,SAAS,CAAC;QACf,OAAO;QACP,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,IAAI,EAAE,eAAe,EAAE;KAC9E,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"verifyES256KSignature.d.ts","sourceRoot":"","sources":["../../../../../src/jwt/core/utils/verifyES256KSignature.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,wBAAsB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,iBAiClF"}
1
+ {"version":3,"file":"verifyES256KSignature.d.ts","sourceRoot":"","sources":["../../../../../src/jwt/core/utils/verifyES256KSignature.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD,wBAAsB,qBAAqB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,iBA8BlF"}
@@ -15,10 +15,7 @@ async function verifyES256KSignature({ decoded }) {
15
15
  // Extract r and s values from the signature
16
16
  const r = signatureBytes.slice(0, 32);
17
17
  const s = signatureBytes.slice(32, 64);
18
- const publicKeyHex = decoded.payload.publicKey.startsWith('0x')
19
- ? decoded.payload.publicKey
20
- : `0x${decoded.payload.publicKey}`;
21
- const publicKeyBytes = (0, utils_1.arrayify)(publicKeyHex);
18
+ const publicKeyBytes = (0, utils_1.arrayify)(decoded.payload.publicKey, { allowMissingPrefix: true });
22
19
  // PKPEthersWallet.signMessage() adds Ethereum prefix, so we need to add it here too
23
20
  const ethPrefixedMessage = '\x19Ethereum Signed Message:\n' + data.length + data;
24
21
  const messageHashBytes = (0, utils_1.arrayify)(ethers_1.ethers.utils.keccak256((0, utils_1.toUtf8Bytes)(ethPrefixedMessage)));
@@ -1 +1 @@
1
- {"version":3,"file":"verifyES256KSignature.js","sourceRoot":"","sources":["../../../../../src/jwt/core/utils/verifyES256KSignature.ts"],"names":[],"mappings":";;AASA,sDAiCC;;AA1CD,oEAA8C;AAC9C,mCAAgC;AAChC,4CAAyD;AAIzD,+CAA4C;AAC5C,qCAAsC;AAE/B,KAAK,UAAU,qBAAqB,CAAC,EAAE,OAAO,EAA8B;IACjF,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;QAEpC,6CAA6C;QAC7C,MAAM,cAAc,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC;QAE7C,4CAA4C;QAC5C,MAAM,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAEvC,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;YAC7D,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS;YAC3B,CAAC,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACrC,MAAM,cAAc,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAC;QAE9C,oFAAoF;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K,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAEvC,MAAM,cAAc,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;QAEzF,oFAAoF;QACpF,MAAM,kBAAkB,GAAG,gCAAgC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACjF,MAAM,gBAAgB,GAAG,IAAA,gBAAQ,EAAC,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAA,mBAAW,EAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;QAE3F,MAAM,gBAAgB,GAAG,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QAEtD,8CAA8C;QAC9C,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;QAExF,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,uCAAuC,SAAS,EAAE,CAAC,CAAC;QACtE,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,GAAG,qBAAS,CAAC,iBAAiB,wBAAyB,KAAe,CAAC,OAAO,EAAE,CACjF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -28,7 +28,7 @@ export interface CreateJWSConfig {
28
28
  config: {
29
29
  audience: string | string[];
30
30
  expiresInMinutes: number;
31
- subjectAddress?: string;
31
+ subjectAddress?: `0x${string}`;
32
32
  role: VincentJWTRole;
33
33
  };
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/jwt/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA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AAE9D;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,GAAG,EAAE;QACH,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,KAAK,MAAM,EAAE,CAAC;CAC/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-app-sdk",
3
- "version": "1.0.3-beta.7",
3
+ "version": "2.0.1",
4
4
  "description": "Vincent SDK for browser and backend",
5
5
  "author": "Lit Protocol",
6
6
  "license": "ISC",
@@ -46,15 +46,15 @@
46
46
  "sdk"
47
47
  ],
48
48
  "dependencies": {
49
- "@lit-protocol/auth-helpers": "^7.0.9",
50
- "@lit-protocol/constants": "^7.0.8",
51
- "@lit-protocol/lit-node-client": "^7.0.8",
52
- "@lit-protocol/vincent-ability-sdk": "0.0.7-mma",
49
+ "@lit-protocol/auth-helpers": "^7.2.3",
50
+ "@lit-protocol/constants": "^7.2.3",
51
+ "@lit-protocol/lit-node-client": "^7.2.3",
53
52
  "@noble/secp256k1": "^2.2.3",
54
53
  "ethers": "5.8.0",
55
54
  "tslib": "^2.8.1",
56
55
  "zod": "3.25.64",
57
- "@lit-protocol/vincent-contracts-sdk": "1.0.0-beta.3"
56
+ "@lit-protocol/vincent-ability-sdk": "2.0.1",
57
+ "@lit-protocol/vincent-contracts-sdk": "1.1.0"
58
58
  },
59
59
  "sideEffects": false,
60
60
  "files": [
@@ -62,8 +62,8 @@
62
62
  "*.md"
63
63
  ],
64
64
  "devDependencies": {
65
- "@lit-protocol/pkp-ethers": "^7.2.0",
66
- "@lit-protocol/types": "^7.0.8",
65
+ "@lit-protocol/pkp-ethers": "^7.2.3",
66
+ "@lit-protocol/types": "^7.2.3",
67
67
  "@types/express": "^5.0.1",
68
68
  "chokidar-cli": "^3.0.0",
69
69
  "live-server": "^1.2.2",