@lit-protocol/vincent-app-sdk 1.0.3-beta.6 → 2.0.0
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 +186 -0
- package/dist/CHANGELOG.md +260 -0
- package/dist/CONTRIBUTING.md +114 -0
- package/dist/README.md +216 -0
- package/dist/package.json +4 -4
- package/dist/src/jwt/core/create.d.ts +1 -2
- package/dist/src/jwt/core/create.d.ts.map +1 -1
- package/dist/src/jwt/core/create.js +6 -4
- package/dist/src/jwt/core/create.js.map +1 -1
- package/dist/src/jwt/core/utils/verifyES256KSignature.js +1 -1
- package/dist/src/jwt/core/utils/verifyES256KSignature.js.map +1 -1
- package/dist/src/jwt/types.d.ts +1 -1
- package/dist/src/jwt/types.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,189 @@
|
|
|
1
|
+
# 2.0.0 (2025-08-05)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- Bug fix in app-sdk that kept a policy's allow result from being returned ([11325427](https://github.com/LIT-Protocol/Vincent/commit/11325427))
|
|
6
|
+
- ### Implement supported Vincent Ability API range ([14f0ece1](https://github.com/LIT-Protocol/Vincent/commit/14f0ece1))
|
|
7
|
+
|
|
8
|
+
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
|
|
9
|
+
|
|
10
|
+
- Added a new jsParam when VincentAbilityClient calls an ability, `vincentAbilityApiVersion`
|
|
11
|
+
- LIT action wrappers for abilities + policies compare `vincentAbilityApiVersion` to match the major semver range the handler was built with from the ability-sdk
|
|
12
|
+
- vincentAbilityHandler() is responsible for passing along the value when it evaluates supported policies
|
|
13
|
+
|
|
14
|
+
### 🩹 Fixes
|
|
15
|
+
|
|
16
|
+
- ### Fix ability failure response cases ([e2be50d9](https://github.com/LIT-Protocol/Vincent/commit/e2be50d9))
|
|
17
|
+
|
|
18
|
+
- Ensures that policy denial disables checking the ability result against its fail schema in the abilityClient, because it will always be undefined :)
|
|
19
|
+
- Ensures that `context` is returned in the response from the abilityClient.execute() method in cases where the ability response was a runtime or schemaValidationError
|
|
20
|
+
|
|
21
|
+
### ⚠️ Breaking Changes
|
|
22
|
+
|
|
23
|
+
- Add support for CBOR2 encoded policy parameters using the new vincent-contracts-sdk ([868c6c2a](https://github.com/LIT-Protocol/Vincent/commit/868c6c2a))
|
|
24
|
+
- ### Add support for explicit `schemaValidationError` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
|
|
25
|
+
|
|
26
|
+
- Previously, a failure to validate either input or results of lifecycle method would result in `result: { zodError }` being returned
|
|
27
|
+
- Now, `result` will be `undefined` and there will be an explicit `schemaValidationError` in the result of the ability / policy
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
export interface SchemaValidationError {
|
|
31
|
+
zodError: ZodError<unknown>; // The result of `zod.safeParse().error`
|
|
32
|
+
phase: string; // Policies: `precheck`|`evaluate`|`commit` - Abilities: `precheck` | `execute`
|
|
33
|
+
stage: string; // `input` | `output`
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- ### `error` is now `runtimeError` and can only be set by `throw ...` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
|
|
38
|
+
|
|
39
|
+
- Previously, if you had not defined a `deny` or `fail` schema, you could call `deny()` or `fail()` with a string
|
|
40
|
+
- That string would end up in the ability/policy response as the `error` property instead of `result`
|
|
41
|
+
- This was problematic because there was no consistent way to identify _un-handled_ error vs. _explicitly returned fail/deny results_
|
|
42
|
+
- If you don't define a deny or fail schema, you can no longer call those methods with a string.
|
|
43
|
+
- `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
|
|
44
|
+
- 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() }`
|
|
45
|
+
|
|
46
|
+
- ### Create vincentAbilityClient namespace ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
47
|
+
|
|
48
|
+
Previously, `getVincentAbilityClient()` and `disconnectVincentAbilityClients()` were exported from the root of the `vincent-app-sdk` package.
|
|
49
|
+
These methods, along with several other methods are now exported from the `@lit-protocol/app-sdk/abilityClient` namespace
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import {
|
|
53
|
+
getVincentAbilityClient,
|
|
54
|
+
disconnectVincentAbilityClients,
|
|
55
|
+
isAbilityResponseFailure,
|
|
56
|
+
isAbilityResponseRuntimeFailure,
|
|
57
|
+
isAbilityResponseSchemaValidationFailure,
|
|
58
|
+
isAbilityResponseSuccess,
|
|
59
|
+
} from '@lit-protocol/app-sdk/abilityClient';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- #### Standardized `app` property on on JWT payload to be a number instead of a string. ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
63
|
+
- #### Renamed `consent page` to `delegation auth page` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
64
|
+
- #### Move utils exports to `@lit-protocol/vincent-app-sdk/utils` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
65
|
+
- #### Moved jwt exports to `@lit-protocol/vincent-app-sdk/jwt` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
66
|
+
|
|
67
|
+
- Enhanced typedocs for all methods and removed type aliases for core functions
|
|
68
|
+
|
|
69
|
+
- #### Move `VincentWebAppClient` exports to `@lit-protocol/vincent-app-sdk/webAppClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
70
|
+
|
|
71
|
+
- Renamed `VincentWebAppClient` to `WebAuthClient`
|
|
72
|
+
- Renamed `VincentAppClientConfig` to `WebAuthClientConfig`
|
|
73
|
+
- Renamed `RedirectToVincentConsentPageParams` to `RedirectToVincentDelegationPageParams`
|
|
74
|
+
- Renamed `redirectToConsentPage()` to `redirectToDelegationAuthPage()`
|
|
75
|
+
- Renamed `getVincentWebAppClient()` to `getWebAuthClient()`
|
|
76
|
+
|
|
77
|
+
- #### Move express-authentication-middleware exports to `@lit-protocol/vincent-app-sdk/expressMiddleware` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
78
|
+
|
|
79
|
+
- Removed `ExpressAuthHelpers` interface - its types are now directly exported from the `expressMiddleware` package sub-path
|
|
80
|
+
|
|
81
|
+
- #### Moved abilityClient exports to `@lit-protocol/vincent-app-sdk/abilityClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
82
|
+
- ### Update express middleware to support non-app-specific JWTs ([9dd1cd26](https://github.com/LIT-Protocol/Vincent/commit/9dd1cd26))
|
|
83
|
+
|
|
84
|
+
- Replaced individual function exports of `authenticatedRequestHandler()` and `getAuthenticateUserExpressHandler()` with a single `createVincentUserMiddleware()` function
|
|
85
|
+
|
|
86
|
+
#### createVincentUserMiddleware({ allowedAudience, userKey, requiredAppId? }) -> { middleware(), handler() }
|
|
87
|
+
|
|
88
|
+
- You can now configure the property on `req` where the vincent user JWT data will be placed using `userKey`
|
|
89
|
+
- You can now configure the authentication middleware to throw if `requiredAppId` does not match a specific appId you provide
|
|
90
|
+
- `allowedAudience` behaviour remains unchanged
|
|
91
|
+
- See example usage on the API docs for the package @ http://docs.heyvincent.ai
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
- ### Support JWTs that are not app-specific ([0553a934](https://github.com/LIT-Protocol/Vincent/commit/0553a934))
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
#### API Changes
|
|
102
|
+
|
|
103
|
+
- `verify` and `decode` functions now accept object parameters instead of separate parameters
|
|
104
|
+
- Their return values are strongly typed based on whether `requiredAppId` is provided.
|
|
105
|
+
- 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`
|
|
106
|
+
- `appId` type changed from `string` to `number` in WebAuthClient configuration
|
|
107
|
+
- WebAuthClient now throws an error if the `appId` it was configured with isn't in the JWT it decodes
|
|
108
|
+
|
|
109
|
+
#### New Functions
|
|
110
|
+
|
|
111
|
+
- `isGeneralJWT`: Type guard to check if a JWT is Vincent JWT that has no app associated
|
|
112
|
+
- `isAppSpecificJWT`: Type guard to check if a JWT is a vincent JWT that is app-specific
|
|
113
|
+
- `assertIsVincentJWT`: Assertion function to validate if a decoded JWT is a valid Vincent JWT
|
|
114
|
+
- `getAppInfo`: Convenience method that returns the app ID and version from an app-specific JWT's payload
|
|
115
|
+
- `getPKPInfo`: Convenience method that returns PKP information from any Vincent JWT's payload
|
|
116
|
+
|
|
117
|
+
#### New Types
|
|
118
|
+
|
|
119
|
+
- `VincentJWT`: Interface for a decoded Vincent JWT without app-specific details (general authentication)
|
|
120
|
+
- `VincentJWTAppSpecific`: Interface for a decoded app-specific Vincent JWT
|
|
121
|
+
- `BaseVincentJWTPayload`: Payload that contains always-present properties on all Vincent JWTs
|
|
122
|
+
- `VincentAppSpecificJWTPayload`: Extends VincentJWTPayload with app-specific information
|
|
123
|
+
|
|
124
|
+
- ## JWT Refactor ([c21bc3c3](https://github.com/LIT-Protocol/Vincent/commit/c21bc3c3))
|
|
125
|
+
|
|
126
|
+
#### Refactored our JWT structure, composition, and verification logic.
|
|
127
|
+
|
|
128
|
+
- Removed dependency on `did-jwt`; since we are signing using EIP-191 compliant signatures, the presence of `did:ethr` was misleading.
|
|
129
|
+
- Added support for Delegatee JWTs
|
|
130
|
+
|
|
131
|
+
#### We now support 3 types of JWT:
|
|
132
|
+
|
|
133
|
+
- `VincentJWTAppUser`
|
|
134
|
+
- `role` claim in the JWT payload is `app-user`
|
|
135
|
+
- Contains PKP info
|
|
136
|
+
- Is app-specific
|
|
137
|
+
- Is provided to app end-users, so that they can authenticate with services that are provided by individual Vincent Apps
|
|
138
|
+
- `VincentJWTPlatformUser`
|
|
139
|
+
- `role` claim in the JWT payload is `platform-user`
|
|
140
|
+
- Contains PKP info
|
|
141
|
+
- Used to authenticate with Vincent platform services (e.g. the registry backend)
|
|
142
|
+
- Is not app-specific
|
|
143
|
+
- The Vincent dashboard uses these for App owners and Ability & Policy authors
|
|
144
|
+
- `VincentJWTDelegatee`
|
|
145
|
+
- `role` claim in the JWT payload is `app-delegatee`
|
|
146
|
+
- Does not contain PKP info; delegatees are not PKP-backed
|
|
147
|
+
- Is not app-specific
|
|
148
|
+
- 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.
|
|
149
|
+
|
|
150
|
+
### API Changes
|
|
151
|
+
|
|
152
|
+
- Many classes and interfaces were renamed to clearly indicate which type of JWT that they apply to.
|
|
153
|
+
- Added `publicKey` to the `payload` of all JWTs for signature verification convenience
|
|
154
|
+
- `iss` and `sub` are now raw hex-formatted ethers addresses, without `did:ethr` prefixes
|
|
155
|
+
- JWT verification has been converted to be an async process, and explicit verify methods have been defined for each type of JWT
|
|
156
|
+
- `verifyVincentAppUserJWT()`
|
|
157
|
+
- `verifyVincentPlatformJWT()`
|
|
158
|
+
- `verifyVincentDelegateeJWT()`
|
|
159
|
+
- 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.
|
|
160
|
+
- `isVincentJWTAppSpecific()`
|
|
161
|
+
- `isVincentPlatformJWT()`
|
|
162
|
+
- `isVincentJWTDelegatee()`
|
|
163
|
+
- `isAnyVincentJWT()`
|
|
164
|
+
- Added accessor helper functions to facilitate easy, type-safe access to properties on supported JWTs
|
|
165
|
+
- `getRole()` - All Vincent JWTs
|
|
166
|
+
- `getPublicKey()` - All Vincent JWTs
|
|
167
|
+
- `getIssuerAddress()` - All Vincent JWTs
|
|
168
|
+
- `getAudience()` - All Vincent JWTs
|
|
169
|
+
- `getSubjectAddress()` - Only for `VincentJWTDelegatee`
|
|
170
|
+
- `getAppInfo()` - Only for `VincentJWTAppUser`
|
|
171
|
+
- `getPKPInfo()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
|
|
172
|
+
- `getAuthentication()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
|
|
173
|
+
- `decode` has been renamed to `decodeVincentJWT()`;
|
|
174
|
+
- 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!
|
|
175
|
+
- This function returns an `AnyVincentJWT` type which you must narrow using type-guard functions.
|
|
176
|
+
|
|
177
|
+
### 🧱 Updated Dependencies
|
|
178
|
+
|
|
179
|
+
- Updated ability-sdk to 2.0.0
|
|
180
|
+
- Updated contracts-sdk to 2.0.0
|
|
181
|
+
|
|
182
|
+
### ❤️ Thank You
|
|
183
|
+
|
|
184
|
+
- Daryl Collins
|
|
185
|
+
- Wyatt Barnes @spacesailor24
|
|
186
|
+
|
|
1
187
|
## 1.0.2 (2025-07-08)
|
|
2
188
|
|
|
3
189
|
### 🩹 Fixes
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# 2.0.0 (2025-08-05)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- Bug fix in app-sdk that kept a policy's allow result from being returned ([11325427](https://github.com/LIT-Protocol/Vincent/commit/11325427))
|
|
6
|
+
- ### Implement supported Vincent Ability API range ([14f0ece1](https://github.com/LIT-Protocol/Vincent/commit/14f0ece1))
|
|
7
|
+
|
|
8
|
+
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
|
|
9
|
+
|
|
10
|
+
- Added a new jsParam when VincentAbilityClient calls an ability, `vincentAbilityApiVersion`
|
|
11
|
+
- LIT action wrappers for abilities + policies compare `vincentAbilityApiVersion` to match the major semver range the handler was built with from the ability-sdk
|
|
12
|
+
- vincentAbilityHandler() is responsible for passing along the value when it evaluates supported policies
|
|
13
|
+
|
|
14
|
+
### 🩹 Fixes
|
|
15
|
+
|
|
16
|
+
- ### Fix ability failure response cases ([e2be50d9](https://github.com/LIT-Protocol/Vincent/commit/e2be50d9))
|
|
17
|
+
|
|
18
|
+
- Ensures that policy denial disables checking the ability result against its fail schema in the abilityClient, because it will always be undefined :)
|
|
19
|
+
- Ensures that `context` is returned in the response from the abilityClient.execute() method in cases where the ability response was a runtime or schemaValidationError
|
|
20
|
+
|
|
21
|
+
### ⚠️ Breaking Changes
|
|
22
|
+
|
|
23
|
+
- Add support for CBOR2 encoded policy parameters using the new vincent-contracts-sdk ([868c6c2a](https://github.com/LIT-Protocol/Vincent/commit/868c6c2a))
|
|
24
|
+
- ### Add support for explicit `schemaValidationError` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
|
|
25
|
+
|
|
26
|
+
- Previously, a failure to validate either input or results of lifecycle method would result in `result: { zodError }` being returned
|
|
27
|
+
- Now, `result` will be `undefined` and there will be an explicit `schemaValidationError` in the result of the ability / policy
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
export interface SchemaValidationError {
|
|
31
|
+
zodError: ZodError<unknown>; // The result of `zod.safeParse().error`
|
|
32
|
+
phase: string; // Policies: `precheck`|`evaluate`|`commit` - Abilities: `precheck` | `execute`
|
|
33
|
+
stage: string; // `input` | `output`
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- ### `error` is now `runtimeError` and can only be set by `throw ...` ([337a4bde](https://github.com/LIT-Protocol/Vincent/commit/337a4bde))
|
|
38
|
+
|
|
39
|
+
- Previously, if you had not defined a `deny` or `fail` schema, you could call `deny()` or `fail()` with a string
|
|
40
|
+
- That string would end up in the ability/policy response as the `error` property instead of `result`
|
|
41
|
+
- This was problematic because there was no consistent way to identify _un-handled_ error vs. _explicitly returned fail/deny results_
|
|
42
|
+
- If you don't define a deny or fail schema, you can no longer call those methods with a string.
|
|
43
|
+
- `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
|
|
44
|
+
- 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() }`
|
|
45
|
+
|
|
46
|
+
- ### Create vincentAbilityClient namespace ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
47
|
+
|
|
48
|
+
Previously, `getVincentAbilityClient()` and `disconnectVincentAbilityClients()` were exported from the root of the `vincent-app-sdk` package.
|
|
49
|
+
These methods, along with several other methods are now exported from the `@lit-protocol/app-sdk/abilityClient` namespace
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import {
|
|
53
|
+
getVincentAbilityClient,
|
|
54
|
+
disconnectVincentAbilityClients,
|
|
55
|
+
isAbilityResponseFailure,
|
|
56
|
+
isAbilityResponseRuntimeFailure,
|
|
57
|
+
isAbilityResponseSchemaValidationFailure,
|
|
58
|
+
isAbilityResponseSuccess,
|
|
59
|
+
} from '@lit-protocol/app-sdk/abilityClient';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- #### Standardized `app` property on on JWT payload to be a number instead of a string. ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
63
|
+
- #### Renamed `consent page` to `delegation auth page` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
64
|
+
- #### Move utils exports to `@lit-protocol/vincent-app-sdk/utils` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
65
|
+
- #### Moved jwt exports to `@lit-protocol/vincent-app-sdk/jwt` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
66
|
+
|
|
67
|
+
- Enhanced typedocs for all methods and removed type aliases for core functions
|
|
68
|
+
|
|
69
|
+
- #### Move `VincentWebAppClient` exports to `@lit-protocol/vincent-app-sdk/webAppClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
70
|
+
|
|
71
|
+
- Renamed `VincentWebAppClient` to `WebAuthClient`
|
|
72
|
+
- Renamed `VincentAppClientConfig` to `WebAuthClientConfig`
|
|
73
|
+
- Renamed `RedirectToVincentConsentPageParams` to `RedirectToVincentDelegationPageParams`
|
|
74
|
+
- Renamed `redirectToConsentPage()` to `redirectToDelegationAuthPage()`
|
|
75
|
+
- Renamed `getVincentWebAppClient()` to `getWebAuthClient()`
|
|
76
|
+
|
|
77
|
+
- #### Move express-authentication-middleware exports to `@lit-protocol/vincent-app-sdk/expressMiddleware` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
78
|
+
|
|
79
|
+
- Removed `ExpressAuthHelpers` interface - its types are now directly exported from the `expressMiddleware` package sub-path
|
|
80
|
+
|
|
81
|
+
- #### Moved abilityClient exports to `@lit-protocol/vincent-app-sdk/abilityClient` ([b94ca569](https://github.com/LIT-Protocol/Vincent/commit/b94ca569))
|
|
82
|
+
- ### Update express middleware to support non-app-specific JWTs ([9dd1cd26](https://github.com/LIT-Protocol/Vincent/commit/9dd1cd26))
|
|
83
|
+
|
|
84
|
+
- Replaced individual function exports of `authenticatedRequestHandler()` and `getAuthenticateUserExpressHandler()` with a single `createVincentUserMiddleware()` function
|
|
85
|
+
|
|
86
|
+
#### createVincentUserMiddleware({ allowedAudience, userKey, requiredAppId? }) -> { middleware(), handler() }
|
|
87
|
+
|
|
88
|
+
- You can now configure the property on `req` where the vincent user JWT data will be placed using `userKey`
|
|
89
|
+
- You can now configure the authentication middleware to throw if `requiredAppId` does not match a specific appId you provide
|
|
90
|
+
- `allowedAudience` behaviour remains unchanged
|
|
91
|
+
- See example usage on the API docs for the package @ http://docs.heyvincent.ai
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
- ### Support JWTs that are not app-specific ([0553a934](https://github.com/LIT-Protocol/Vincent/commit/0553a934))
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
#### API Changes
|
|
102
|
+
|
|
103
|
+
- `verify` and `decode` functions now accept object parameters instead of separate parameters
|
|
104
|
+
- Their return values are strongly typed based on whether `requiredAppId` is provided.
|
|
105
|
+
- 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`
|
|
106
|
+
- `appId` type changed from `string` to `number` in WebAuthClient configuration
|
|
107
|
+
- WebAuthClient now throws an error if the `appId` it was configured with isn't in the JWT it decodes
|
|
108
|
+
|
|
109
|
+
#### New Functions
|
|
110
|
+
|
|
111
|
+
- `isGeneralJWT`: Type guard to check if a JWT is Vincent JWT that has no app associated
|
|
112
|
+
- `isAppSpecificJWT`: Type guard to check if a JWT is a vincent JWT that is app-specific
|
|
113
|
+
- `assertIsVincentJWT`: Assertion function to validate if a decoded JWT is a valid Vincent JWT
|
|
114
|
+
- `getAppInfo`: Convenience method that returns the app ID and version from an app-specific JWT's payload
|
|
115
|
+
- `getPKPInfo`: Convenience method that returns PKP information from any Vincent JWT's payload
|
|
116
|
+
|
|
117
|
+
#### New Types
|
|
118
|
+
|
|
119
|
+
- `VincentJWT`: Interface for a decoded Vincent JWT without app-specific details (general authentication)
|
|
120
|
+
- `VincentJWTAppSpecific`: Interface for a decoded app-specific Vincent JWT
|
|
121
|
+
- `BaseVincentJWTPayload`: Payload that contains always-present properties on all Vincent JWTs
|
|
122
|
+
- `VincentAppSpecificJWTPayload`: Extends VincentJWTPayload with app-specific information
|
|
123
|
+
|
|
124
|
+
- ## JWT Refactor ([c21bc3c3](https://github.com/LIT-Protocol/Vincent/commit/c21bc3c3))
|
|
125
|
+
|
|
126
|
+
#### Refactored our JWT structure, composition, and verification logic.
|
|
127
|
+
|
|
128
|
+
- Removed dependency on `did-jwt`; since we are signing using EIP-191 compliant signatures, the presence of `did:ethr` was misleading.
|
|
129
|
+
- Added support for Delegatee JWTs
|
|
130
|
+
|
|
131
|
+
#### We now support 3 types of JWT:
|
|
132
|
+
|
|
133
|
+
- `VincentJWTAppUser`
|
|
134
|
+
- `role` claim in the JWT payload is `app-user`
|
|
135
|
+
- Contains PKP info
|
|
136
|
+
- Is app-specific
|
|
137
|
+
- Is provided to app end-users, so that they can authenticate with services that are provided by individual Vincent Apps
|
|
138
|
+
- `VincentJWTPlatformUser`
|
|
139
|
+
- `role` claim in the JWT payload is `platform-user`
|
|
140
|
+
- Contains PKP info
|
|
141
|
+
- Used to authenticate with Vincent platform services (e.g. the registry backend)
|
|
142
|
+
- Is not app-specific
|
|
143
|
+
- The Vincent dashboard uses these for App owners and Ability & Policy authors
|
|
144
|
+
- `VincentJWTDelegatee`
|
|
145
|
+
- `role` claim in the JWT payload is `app-delegatee`
|
|
146
|
+
- Does not contain PKP info; delegatees are not PKP-backed
|
|
147
|
+
- Is not app-specific
|
|
148
|
+
- 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.
|
|
149
|
+
|
|
150
|
+
### API Changes
|
|
151
|
+
|
|
152
|
+
- Many classes and interfaces were renamed to clearly indicate which type of JWT that they apply to.
|
|
153
|
+
- Added `publicKey` to the `payload` of all JWTs for signature verification convenience
|
|
154
|
+
- `iss` and `sub` are now raw hex-formatted ethers addresses, without `did:ethr` prefixes
|
|
155
|
+
- JWT verification has been converted to be an async process, and explicit verify methods have been defined for each type of JWT
|
|
156
|
+
- `verifyVincentAppUserJWT()`
|
|
157
|
+
- `verifyVincentPlatformJWT()`
|
|
158
|
+
- `verifyVincentDelegateeJWT()`
|
|
159
|
+
- 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.
|
|
160
|
+
- `isVincentJWTAppSpecific()`
|
|
161
|
+
- `isVincentPlatformJWT()`
|
|
162
|
+
- `isVincentJWTDelegatee()`
|
|
163
|
+
- `isAnyVincentJWT()`
|
|
164
|
+
- Added accessor helper functions to facilitate easy, type-safe access to properties on supported JWTs
|
|
165
|
+
- `getRole()` - All Vincent JWTs
|
|
166
|
+
- `getPublicKey()` - All Vincent JWTs
|
|
167
|
+
- `getIssuerAddress()` - All Vincent JWTs
|
|
168
|
+
- `getAudience()` - All Vincent JWTs
|
|
169
|
+
- `getSubjectAddress()` - Only for `VincentJWTDelegatee`
|
|
170
|
+
- `getAppInfo()` - Only for `VincentJWTAppUser`
|
|
171
|
+
- `getPKPInfo()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
|
|
172
|
+
- `getAuthentication()` - Only for `VincentJWTAppUser` or `VincentJWTPlatformUser`
|
|
173
|
+
- `decode` has been renamed to `decodeVincentJWT()`;
|
|
174
|
+
- 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!
|
|
175
|
+
- This function returns an `AnyVincentJWT` type which you must narrow using type-guard functions.
|
|
176
|
+
|
|
177
|
+
### 🧱 Updated Dependencies
|
|
178
|
+
|
|
179
|
+
- Updated ability-sdk to 2.0.0
|
|
180
|
+
- Updated contracts-sdk to 2.0.0
|
|
181
|
+
|
|
182
|
+
### ❤️ Thank You
|
|
183
|
+
|
|
184
|
+
- Daryl Collins
|
|
185
|
+
- Wyatt Barnes @spacesailor24
|
|
186
|
+
|
|
187
|
+
## 1.0.2 (2025-07-08)
|
|
188
|
+
|
|
189
|
+
### 🩹 Fixes
|
|
190
|
+
|
|
191
|
+
- #### VincentAbilityClient Precheck fixes ([8da32df2](https://github.com/LIT-Protocol/Vincent/commit/8da32df2))
|
|
192
|
+
|
|
193
|
+
- Fix a case where deny results from `precheck()` were not correctly bubbled to the caller
|
|
194
|
+
- Fixed incorrect return type shape - `error` is a sibling of `result` in the policiesContext- Ensured `error` is bubbled up to the caller when provided
|
|
195
|
+
|
|
196
|
+
- - VincentAbilityClient - Expose correct policiesContext type when calling `precheck()` ([812d4fe9](https://github.com/LIT-Protocol/Vincent/commit/812d4fe9))
|
|
197
|
+
- - `VincentAbilityClient` - Fixed case where an ability without its own `precheck()` function would return `success` result even if a policy returned an `deny` result from its `precheck()` ([71380b89](https://github.com/LIT-Protocol/Vincent/commit/71380b89))
|
|
198
|
+
- - `VincentAbilityClient` - Fixed case where a fail response did not return the `error` or `result` response to the caller correctly ([30e32f1e](https://github.com/LIT-Protocol/Vincent/commit/30e32f1e))
|
|
199
|
+
|
|
200
|
+
### 🧱 Updated Dependencies
|
|
201
|
+
|
|
202
|
+
- Updated ability-sdk to 1.0.2
|
|
203
|
+
|
|
204
|
+
### ❤️ Thank You
|
|
205
|
+
|
|
206
|
+
- Daryl Collins
|
|
207
|
+
|
|
208
|
+
## 0.0.7 (2025-05-26)
|
|
209
|
+
|
|
210
|
+
### 🚀 Features
|
|
211
|
+
|
|
212
|
+
- improved mcp api doc ([0389014](https://github.com/LIT-Protocol/Vincent/commit/0389014))
|
|
213
|
+
- updated Vincent MCP documentation with its own section ([3457891](https://github.com/LIT-Protocol/Vincent/commit/3457891))
|
|
214
|
+
- add documentation ([f539eb5](https://github.com/LIT-Protocol/Vincent/commit/f539eb5))
|
|
215
|
+
- implementation of the vincent mcp server stdio and http runners using the app to mcp transformer in the sdk ([aa58c17](https://github.com/LIT-Protocol/Vincent/commit/aa58c17))
|
|
216
|
+
- implementation of the vincent app mcp wrapper ([02dd8ca](https://github.com/LIT-Protocol/Vincent/commit/02dd8ca))
|
|
217
|
+
- add release script to release SDK and its doc to npm and vercel ([eaccd5f](https://github.com/LIT-Protocol/Vincent/commit/eaccd5f))
|
|
218
|
+
- **docs:** change title, downgrade for plugin extras ([cdd62c0](https://github.com/LIT-Protocol/Vincent/commit/cdd62c0))
|
|
219
|
+
- use standard syntax for jwt validation errors and move validation to decoding step ([fefbbc6](https://github.com/LIT-Protocol/Vincent/commit/fefbbc6))
|
|
220
|
+
- deduplicate vincent data in decoded jwt and revert building config changes ([481d131](https://github.com/LIT-Protocol/Vincent/commit/481d131))
|
|
221
|
+
- change ts compiler config to increase compatibility surface and fix usage in DCA FE vite app ([027582d](https://github.com/LIT-Protocol/Vincent/commit/027582d))
|
|
222
|
+
- add authorized app and user info to jwt ([237f70d](https://github.com/LIT-Protocol/Vincent/commit/237f70d))
|
|
223
|
+
- **vincent-app-sdk:** add Express authentication helpers and update docs ([14a04b3](https://github.com/LIT-Protocol/Vincent/commit/14a04b3))
|
|
224
|
+
- **vincent-app-sdk:** Update README.md ([d052e18](https://github.com/LIT-Protocol/Vincent/commit/d052e18))
|
|
225
|
+
- **vincent-app-sdk:** Add sdk-docs TypeDocs to root of repo ([fb15599](https://github.com/LIT-Protocol/Vincent/commit/fb15599))
|
|
226
|
+
- **vincent-app-sdk:** Return both the original JWT string and the decoded JWT object from `decodeVincentLoginJWT()` - Also fixed inverted logic check for `isLoginUri()`, and converted to object params for `isLoginUri()` ([c2f3a19](https://github.com/LIT-Protocol/Vincent/commit/c2f3a19))
|
|
227
|
+
- **vincent-app-sdk:** Add `removeLoginJWTFromURI()` method to `VincentWebAppClient` ([17072f4](https://github.com/LIT-Protocol/Vincent/commit/17072f4))
|
|
228
|
+
- **vincent-app-sdk:** Replace `pkp/delegatee-sigs` with a `VincentAbilityClient` - Exposes a single method, `getVincentAbilityClient()`, which Vincent app developers will use to interact with Vincent Ability LIT actions - Fixes existing code that created new instances of LitNodeClient and connecting to them every time the ability is interacted with, using newly minted singleton module - Initial TSDoc configurations for exposing the ability client construction and usage under a 'Vincent Abilities' category. ([2052ebe](https://github.com/LIT-Protocol/Vincent/commit/2052ebe))
|
|
229
|
+
- **vincent-app-sdk:** Define an internal module for managing a singleton instance of a LitNodeClient ([d297b0c](https://github.com/LIT-Protocol/Vincent/commit/d297b0c))
|
|
230
|
+
- update vincent sdk readme ([090614d](https://github.com/LIT-Protocol/Vincent/commit/090614d))
|
|
231
|
+
- added contracts class ([ef1851e](https://github.com/LIT-Protocol/Vincent/commit/ef1851e))
|
|
232
|
+
|
|
233
|
+
### 🩹 Fixes
|
|
234
|
+
|
|
235
|
+
- ZodSchemmaMap typo ([095f38e](https://github.com/LIT-Protocol/Vincent/commit/095f38e))
|
|
236
|
+
- doc reference ([b1450f8](https://github.com/LIT-Protocol/Vincent/commit/b1450f8))
|
|
237
|
+
- remove unnecessary type annotation ([c71eeac](https://github.com/LIT-Protocol/Vincent/commit/c71eeac))
|
|
238
|
+
- sdk nx project linting ability ([82dd819](https://github.com/LIT-Protocol/Vincent/commit/82dd819))
|
|
239
|
+
- **docs:** rename (remove API) ([a4b8e83](https://github.com/LIT-Protocol/Vincent/commit/a4b8e83))
|
|
240
|
+
- **docs:** formatting fixes, custom css for :::info ([6f2fcef](https://github.com/LIT-Protocol/Vincent/commit/6f2fcef))
|
|
241
|
+
- **vincent-app-sdk:** Fix import of `JWT_ERROR` to import from root of `did-jwt` package ([dd96111](https://github.com/LIT-Protocol/Vincent/commit/dd96111))
|
|
242
|
+
- do not export simple jwt manipulating functions. Consumers should use the sdk directly ([6e46eee](https://github.com/LIT-Protocol/Vincent/commit/6e46eee))
|
|
243
|
+
- **publish:** need to include 'dist' ([ecf38c3](https://github.com/LIT-Protocol/Vincent/commit/ecf38c3))
|
|
244
|
+
- **sdk:** package.json exports ([dd35563](https://github.com/LIT-Protocol/Vincent/commit/dd35563))
|
|
245
|
+
- no need types node ([af98c0e](https://github.com/LIT-Protocol/Vincent/commit/af98c0e))
|
|
246
|
+
- **build:** add missing tsconfig.lib.json ([ce47c23](https://github.com/LIT-Protocol/Vincent/commit/ce47c23))
|
|
247
|
+
- **jest:** enable `passWithNoTests` ([0f4ac57](https://github.com/LIT-Protocol/Vincent/commit/0f4ac57))
|
|
248
|
+
- lint and any ([c4fc2ab](https://github.com/LIT-Protocol/Vincent/commit/c4fc2ab))
|
|
249
|
+
- **deps:** correctly scope dependencies between global & individual packages ([b3fdb8c](https://github.com/LIT-Protocol/Vincent/commit/b3fdb8c))
|
|
250
|
+
- **build:** remove rollup and use default nx settings ([b3769df](https://github.com/LIT-Protocol/Vincent/commit/b3769df))
|
|
251
|
+
- minor changes ([0a70d4a](https://github.com/LIT-Protocol/Vincent/commit/0a70d4a))
|
|
252
|
+
- removed umd build ([6e532fa](https://github.com/LIT-Protocol/Vincent/commit/6e532fa))
|
|
253
|
+
|
|
254
|
+
### ❤️ Thank You
|
|
255
|
+
|
|
256
|
+
- Ansh Saxena @anshss
|
|
257
|
+
- Anson
|
|
258
|
+
- awisniew207 @awisniew207
|
|
259
|
+
- Daryl Collins
|
|
260
|
+
- FedericoAmura @FedericoAmura
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Contributing to Vincent SDK
|
|
2
|
+
|
|
3
|
+
This document provides guidelines for contributing to the Vincent SDK project.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Vincent SDK is a TypeScript SDK that exposes useful abilities to interact with Vincent systems in web or Node.js environments. It provides client libraries for both frontend applications and backend services.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
1. Follow the global setup instructions in the repository root [CONTRIBUTING.md](../../CONTRIBUTING.md).
|
|
12
|
+
2. Install dependencies:
|
|
13
|
+
```bash
|
|
14
|
+
pnpm install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Development Workflow
|
|
18
|
+
|
|
19
|
+
### Building
|
|
20
|
+
|
|
21
|
+
Build the SDK:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm build
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
|
|
29
|
+
Generate TypeDoc documentation:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm typedoc
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Project Structure
|
|
36
|
+
|
|
37
|
+
- `src/`: Source code
|
|
38
|
+
- `index.ts`: Main entry point
|
|
39
|
+
- `app/`: Web utilities to authenticate against Vincent Apps in clients
|
|
40
|
+
- `express-authentication-middleware/`: Express middleware wrapper to properly validate clients JWT server side
|
|
41
|
+
- `jwt/`: Utility functions to work with Vincent JWT between Vincent Apps client and server
|
|
42
|
+
|
|
43
|
+
## SDK Components
|
|
44
|
+
|
|
45
|
+
### WebAuthClient
|
|
46
|
+
|
|
47
|
+
The Vincent Web Auth Client provides methods for managing user authentication, JWT tokens, and connect flows in Vincent applications.
|
|
48
|
+
|
|
49
|
+
### VincentAbilityClient
|
|
50
|
+
|
|
51
|
+
The Vincent Ability Client uses an ethers signer for your delegatee account to run Vincent Abilities on behalf of your app users.
|
|
52
|
+
|
|
53
|
+
## Coding Standards
|
|
54
|
+
|
|
55
|
+
1. Use TypeScript for all new code
|
|
56
|
+
2. Follow the project's existing coding style
|
|
57
|
+
3. Write clear, descriptive comments and JSDoc for public APIs
|
|
58
|
+
4. Include appropriate error handling
|
|
59
|
+
5. Write unit tests for new functionality
|
|
60
|
+
6. Maintain backward compatibility when possible
|
|
61
|
+
|
|
62
|
+
## Type Safety
|
|
63
|
+
|
|
64
|
+
- Use proper TypeScript types for all functions and variables
|
|
65
|
+
- Avoid using `any` type; prefer `unknown` when the type is truly unknown
|
|
66
|
+
- Use generics where appropriate to maintain type safety
|
|
67
|
+
- Ensure exported APIs have proper type definitions
|
|
68
|
+
|
|
69
|
+
## Testing
|
|
70
|
+
|
|
71
|
+
Write unit tests for new functionality:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pnpm test
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Documentation
|
|
78
|
+
|
|
79
|
+
- Document all public APIs with JSDoc comments
|
|
80
|
+
- Update README.md when adding new features
|
|
81
|
+
- Generate and review TypeDoc documentation
|
|
82
|
+
|
|
83
|
+
## Pull Request Process
|
|
84
|
+
|
|
85
|
+
1. Ensure your code follows the coding standards
|
|
86
|
+
2. Update documentation if necessary
|
|
87
|
+
3. Include tests for new features or bug fixes
|
|
88
|
+
4. Link any related issues in your pull request description
|
|
89
|
+
5. Add an nx version plan documenting your changes
|
|
90
|
+
6. Request a review from a maintainer
|
|
91
|
+
|
|
92
|
+
## For AI Editors and IDEs
|
|
93
|
+
|
|
94
|
+
When working with AI-powered editors like Cursor, GitHub Copilot, or other AI assistants in this project directory, please note:
|
|
95
|
+
|
|
96
|
+
### Context Priority
|
|
97
|
+
|
|
98
|
+
1. **Primary Context**: When working within the SDK project directory, AI editors should prioritize this CONTRIBUTING.md file and the project's README.md for specific guidance on the SDK project.
|
|
99
|
+
|
|
100
|
+
2. **Secondary Context**: The root-level CONTRIBUTING.md and README.md files provide important context about how this project fits into the broader Vincent ecosystem.
|
|
101
|
+
|
|
102
|
+
### Key Files for SDK Context
|
|
103
|
+
|
|
104
|
+
- `/packages/libs/app-sdk/README.md`: Overview of the SDK project
|
|
105
|
+
- `/packages/libs/app-sdk/CONTRIBUTING.md`: This file, with SDK-specific contribution guidelines
|
|
106
|
+
- `/packages/libs/app-sdk/src/`: Source code for the SDK
|
|
107
|
+
|
|
108
|
+
When working on SDK code, consider these dependencies and consumers for context.
|
|
109
|
+
|
|
110
|
+
## Additional Resources
|
|
111
|
+
|
|
112
|
+
- [Vincent Documentation](https://docs.heyvincent.ai/)
|
|
113
|
+
- [SDK Documentation](https://sdk-docs.heyvincent.ai/)
|
|
114
|
+
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Vincent SDK
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install @lit-protocol/vincent-app-sdk
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
# Client (Web)
|
|
12
|
+
|
|
13
|
+
## WebAuthClient
|
|
14
|
+
|
|
15
|
+
The Vincent Web Auth Client provides methods for managing user authentication, JWT tokens, and connect flows in Vincent applications.
|
|
16
|
+
|
|
17
|
+
### Methods
|
|
18
|
+
|
|
19
|
+
#### redirectToConnectPage()
|
|
20
|
+
|
|
21
|
+
Redirects the user to the Vincent connect page to obtain authorization. Once the user has completed the vincent connect flow
|
|
22
|
+
they will be redirected back to your app with a signed JWT that you can use to authenticate requests against your backend APIs
|
|
23
|
+
|
|
24
|
+
- When a JWT is expired, you need to use this method to get a new JWT
|
|
25
|
+
|
|
26
|
+
#### uriContainsVincentJWT()
|
|
27
|
+
|
|
28
|
+
Checks if the current window location contains a Vincent connect JWT. You can use this method to know that you should update connect state with the newly provided JWT
|
|
29
|
+
|
|
30
|
+
- Returns: Boolean indicating if the URI contains a connect JWT
|
|
31
|
+
|
|
32
|
+
#### decodeVincentJWT(expectedAudience)
|
|
33
|
+
|
|
34
|
+
Decodes a Vincent connect JWT. Performs basic sanity check but does not perform full verify() logic. You will want to run `verify()` from the jwt abilities to verify the JWT is fully valid and not expired etc.
|
|
35
|
+
|
|
36
|
+
- The expected audience is typically your app's domain -- it should be one of your valid redirectUri values from your Vincent app configuration
|
|
37
|
+
|
|
38
|
+
- Returns: An object containing both the original JWT string and the decoded JWT object
|
|
39
|
+
|
|
40
|
+
#### removeVincentJWTFromURI()
|
|
41
|
+
|
|
42
|
+
Removes the connect JWT parameter from the current URI. Call this after you have verified and stored the JWT for later usage.
|
|
43
|
+
|
|
44
|
+
### Basic Usage
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { getWebAuthClient } from '@lit-protocol/vincent-app-sdk/webaAthClient';
|
|
48
|
+
import { isExpired } from '@lit-protocol/vincent-app-sdk/jwt';
|
|
49
|
+
|
|
50
|
+
const vincentAppClient = getWebAuthClient({ appId: MY_APP_ID });
|
|
51
|
+
// ... In your app logic:
|
|
52
|
+
if (vincentAppClient.uriContainsVincentJWT()) {
|
|
53
|
+
// Handle app logic for the user has just logged in
|
|
54
|
+
const { decoded, jwt } = vincentAppClient.decodeVincentJWTFromUri(window.location.origin);
|
|
55
|
+
// Store `jwt` for later usage; the user is now logged in.
|
|
56
|
+
} else {
|
|
57
|
+
// Handle app logic for the user is _already logged in_ (check for stored & unexpired JWT)
|
|
58
|
+
|
|
59
|
+
const jwt = localStorage.getItem('VINCENT_AUTH_JWT');
|
|
60
|
+
if (jwt && isExpired(jwt)) {
|
|
61
|
+
// User must re-log in
|
|
62
|
+
vincentAppClient.redirectToConnectPage({ redirectUri: window.location.href });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!jwt) {
|
|
66
|
+
// Handle app logic for the user is not yet logged in
|
|
67
|
+
vincentAppClient.redirectToConnectPage({ redirectUri: window.location.href });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
# Backend
|
|
73
|
+
|
|
74
|
+
In your backend, you will have to verify the JWT to make sure the user has granted you the required permissions to act on their behalf.
|
|
75
|
+
|
|
76
|
+
## VincentAbilityClient
|
|
77
|
+
|
|
78
|
+
The Vincent Ability Client uses an ethers signer for your delegatee account to run Vincent Abilities on behalf of your app users.
|
|
79
|
+
|
|
80
|
+
This client will typically be used by an AI agent or your app backend service, as it requires a signer that conforms to the ethers v5 signer API, and with access to your delegatee account's private key to authenticate with the LIT network when executing the Vincent Ability.
|
|
81
|
+
|
|
82
|
+
### Configuration
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
interface VincentAbilityClientConfig {
|
|
86
|
+
ethersSigner: ethers.Signer; // An ethers v5 compatible signer
|
|
87
|
+
vincentAbilityCid: string; // The CID of the Vincent Ability to execute
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Methods
|
|
92
|
+
|
|
93
|
+
#### execute(params: VincentAbilityParams): Promise<ExecuteJsResponse>
|
|
94
|
+
|
|
95
|
+
Executes a Vincent Ability with the provided parameters.
|
|
96
|
+
|
|
97
|
+
- `params`: Record<string, unknown> - Parameters to pass to the Vincent Ability
|
|
98
|
+
- Returns: Promise resolving to an ExecuteJsResponse from the LIT network
|
|
99
|
+
|
|
100
|
+
### Ability execution
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { getVincentAbilityClient } from '@lit-protocol/vincent-app-sdk/abilityClient';
|
|
104
|
+
// Import the ability you want to execute
|
|
105
|
+
import { bundledVincentAbility as erc20BundledAbility } from '@lit-protocol/vincent-ability-erc20-approval';
|
|
106
|
+
|
|
107
|
+
// One of delegatee signers from your app's Vincent Dashboard
|
|
108
|
+
const delegateeSigner = new ethers.Wallet('YOUR_DELEGATEE_PRIVATE_KEY');
|
|
109
|
+
|
|
110
|
+
// Initialize the Vincent Ability Client
|
|
111
|
+
const abilityClient = getVincentAbilityClient({
|
|
112
|
+
ethersSigner: delegateeSigner,
|
|
113
|
+
bundledVincentAbility: erc20BundledAbility,
|
|
114
|
+
});
|
|
115
|
+
const delegatorPkpEthAddress = '0x09182301238';
|
|
116
|
+
|
|
117
|
+
const abilityParams = {
|
|
118
|
+
// Fill with the params your ability needs
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Run precheck to see if ability should be executed
|
|
122
|
+
const precheckResult = await client.precheck(abilityParams, {
|
|
123
|
+
delegatorPkpEthAddress,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
if (precheckResult.success === true) {
|
|
127
|
+
// Execute the Vincent Ability
|
|
128
|
+
const executeResult = await client.execute(abilityParams, {
|
|
129
|
+
delegatorPkpEthAddress,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// ...ability has executed, you can check `executeResult` for details
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Usage
|
|
137
|
+
|
|
138
|
+
### Authentication
|
|
139
|
+
|
|
140
|
+
A basic Express authentication middleware factory function is provided with the SDK.
|
|
141
|
+
|
|
142
|
+
- Create an express middleware using `getAuthenticateUserExpressHandler()`
|
|
143
|
+
- Once you have added the middleware to your route, use `authenticatedRequestHandler()` to provide
|
|
144
|
+
type-safe access to `req.user` in your downstream RequestHandler functions.
|
|
145
|
+
- When defining your authenticated routes, use the `ExpressAuthHelpers` type to type your functions and function arguments.
|
|
146
|
+
|
|
147
|
+
See getAuthenticateUserExpressHandler() documentation to see the source for the express authentication route handler
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
import {
|
|
151
|
+
authenticatedRequestHandler,
|
|
152
|
+
getAuthenticateUserExpressHandler,
|
|
153
|
+
} from '@lit-protocol/vincent-app-sdk/expressMiddleware';
|
|
154
|
+
|
|
155
|
+
import type { AuthenticatedRequest } from '@lit-protocol/vincent-app-sdk/expressMiddleware';
|
|
156
|
+
|
|
157
|
+
const { ALLOWED_AUDIENCE } = process.env;
|
|
158
|
+
|
|
159
|
+
const authenticateUserMiddleware = getAuthenticateUserExpressHandler(ALLOWED_AUDIENCE);
|
|
160
|
+
|
|
161
|
+
// Define an authenticated route handler
|
|
162
|
+
const getUserProfile = async (req: AuthenticatedRequest, res: Response) => {
|
|
163
|
+
// Access authenticated user information
|
|
164
|
+
const { pkpAddress } = req.user;
|
|
165
|
+
|
|
166
|
+
// Fetch and return user data
|
|
167
|
+
const userData = await userRepository.findByAddress(pkpAddress);
|
|
168
|
+
res.json(userData);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// Use in Express route with authentication
|
|
172
|
+
app.get('/profile', authenticateUser, authenticatedRequestHandler(getUserProfile));
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## JWT Authentication
|
|
176
|
+
|
|
177
|
+
### Overview
|
|
178
|
+
|
|
179
|
+
The JWT authentication system in Vincent SDK allows for secure communication between user applications and Vincent Abilities. JWTs are used to verify user connect and authorize ability executions.
|
|
180
|
+
|
|
181
|
+
### Authentication Flow
|
|
182
|
+
|
|
183
|
+
1. User initiates an action requiring Vincent Ability access
|
|
184
|
+
2. Application redirects to the Vincent connect page using `VincentWebAppClient.redirectToConnectPage()`
|
|
185
|
+
3. User provides login for the requested abilities/policies
|
|
186
|
+
4. User is redirected back to the application with a JWT in the URL
|
|
187
|
+
5. Application validates and stores the JWT using `VincentWebAppClient` methods
|
|
188
|
+
6. JWT is used to authenticate with the app backend
|
|
189
|
+
|
|
190
|
+
### JWT Structure
|
|
191
|
+
|
|
192
|
+
Vincent JWTs contain:
|
|
193
|
+
|
|
194
|
+
- User account identity information (pkpAddress and pkpPublicKey)
|
|
195
|
+
- Expiration timestamp
|
|
196
|
+
- Signature from the Vincent authorization service
|
|
197
|
+
|
|
198
|
+
### Error Handling
|
|
199
|
+
|
|
200
|
+
When JWT validation fails, descriptive error messages are thrown to help with troubleshooting.
|
|
201
|
+
|
|
202
|
+
### Usage Notes
|
|
203
|
+
|
|
204
|
+
- JWTs have an expiration time after which they are no longer valid
|
|
205
|
+
- When a JWT expires, redirect the user to the connect page to obtain a new one using the `VincentWebAppClient`
|
|
206
|
+
|
|
207
|
+
## Release
|
|
208
|
+
|
|
209
|
+
Pre-requisites:
|
|
210
|
+
|
|
211
|
+
- You will need a valid npm account with access to the `@lit-protocol` organization.
|
|
212
|
+
- Run `pnpm vercel login` at sdk root to get a authentication token for vercel
|
|
213
|
+
- Also you will need to fill the `.env` file with the vercel project and org ids for the [vincent-docs](https://vercel.com/lit-protocol/vincent-docs) project.
|
|
214
|
+
|
|
215
|
+
Then run `pnpm release` on the repository root. It will prompt you to update the Vincent SDK version and then ask you to confirm the release.
|
|
216
|
+
This process will also generate a `CHANGELOG.md` record with the changes for the release and update typedoc in vercel after publishing the SDK.
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lit-protocol/vincent-app-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vincent SDK for browser and backend",
|
|
5
5
|
"author": "Lit Protocol",
|
|
6
6
|
"license": "ISC",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@lit-protocol/auth-helpers": "^7.0.9",
|
|
56
56
|
"@lit-protocol/constants": "^7.0.8",
|
|
57
57
|
"@lit-protocol/lit-node-client": "^7.0.8",
|
|
58
|
-
"@lit-protocol/vincent-ability-sdk": "
|
|
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",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"typedoc-plugin-zod": "^1.4.1",
|
|
80
80
|
"vercel": "^41.6.2"
|
|
81
81
|
},
|
|
82
|
-
"types": "./
|
|
83
|
-
"main": "./
|
|
82
|
+
"types": "./src/index.d.ts",
|
|
83
|
+
"main": "./src/index.js",
|
|
84
84
|
"type": "commonjs"
|
|
85
85
|
}
|
|
@@ -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
|
-
*
|
|
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,
|
|
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
|
|
30
|
-
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
|
-
*
|
|
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/create.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/jwt/core/create.ts"],"names":[],"mappings":";;AAoEA,sDAYC;AAKD,4CAqBC;AASD,gDAQC;AA3HD,4CAAkF;AAWlF,4CAAuD;AACvD,2CAA6C;AAE7C,MAAM,SAAS,GAAG,CAAC,CAAS,EAAiB,EAAE,CAC7C,IAAA,eAAO,EAAC,CAAC,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAkB,CAAC;AAE5D,SAAS,kBAAkB,CAAC,MAAuB;IACjD,OAAO,KAAK,EAAE,IAAyB,EAAmB,EAAE;QAC1D,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACzE,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACnD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAA,sBAAc,EAAC,GAAG,CAAC,CAAC;QACrC,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QACpC,QAAQ,CAAC,GAAG,CAAC,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7B,QAAQ,CAAC,GAAG,CAAC,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,OAAO,IAAA,oBAAW,EAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAmB;IACnE,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,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AAED;;;KAGK;AACE,KAAK,UAAU,qBAAqB,CAAC,MAAmC;IAC7E,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,OAAO,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IAEhG,OAAO,SAAS,CAAC;QACf,OAAO,EAAE;YACP,GAAG,OAAO;YACV,OAAO;YACP,cAAc;SACf;QACD,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE;KAC9D,CAAC,CAAC;AACL,CAAC;AAED;;KAEK;AACE,KAAK,UAAU,gBAAgB,CAAC,MAA8B;IACnE,MAAM,EACJ,GAAG,EACH,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,OAAO,GAAG,EAAE,GACb,GAAG,MAAM,CAAC;IAEX,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"}
|
|
@@ -15,7 +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 publicKeyBytes = (0, utils_1.arrayify)(decoded.payload.publicKey);
|
|
18
|
+
const publicKeyBytes = (0, utils_1.arrayify)(decoded.payload.publicKey, { allowMissingPrefix: true });
|
|
19
19
|
// PKPEthersWallet.signMessage() adds Ethereum prefix, so we need to add it here too
|
|
20
20
|
const ethPrefixedMessage = '\x19Ethereum Signed Message:\n' + data.length + data;
|
|
21
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,sDA8BC;;AAvCD,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,cAAc,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"verifyES256KSignature.js","sourceRoot":"","sources":["../../../../../src/jwt/core/utils/verifyES256KSignature.ts"],"names":[],"mappings":";;AASA,sDA8BC;;AAvCD,oEAA8C;AAC9C,mCAAg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E,CACjF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/src/jwt/types.d.ts
CHANGED
|
@@ -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,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC,CAAC;AAExE;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,WAAW,GACX,MAAM,GACN,wBAAwB,CAAC;AAE7B,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,IAAI;KACzC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACjC,GAAG;KACD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK;CACjB,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,+BAA+B,GAAG,YAAY,CACxD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnB,wBAAwB,CACzB,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,+BAA+B,CAAC;IACzC,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC5B,gBAAgB,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/jwt/types.ts"],"names":[],"mappings":"AAAA,OAAO,KA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G,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,sBAAsB,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAE7F,UAAU,aAAa;IACrB,OAAO,CAAC,EAAE,+BAA+B,CAAC;IAC1C,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,UAAU,mBAAoB,SAAQ,aAAa;IACjD,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAC;IACnB,cAAc,EAAE,uBAAuB,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;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": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vincent SDK for browser and backend",
|
|
5
5
|
"author": "Lit Protocol",
|
|
6
6
|
"license": "ISC",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@lit-protocol/auth-helpers": "^7.0.9",
|
|
50
50
|
"@lit-protocol/constants": "^7.0.8",
|
|
51
51
|
"@lit-protocol/lit-node-client": "^7.0.8",
|
|
52
|
-
"@lit-protocol/vincent-ability-sdk": "0.0.7-mma",
|
|
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-
|
|
56
|
+
"@lit-protocol/vincent-ability-sdk": "2.0.0",
|
|
57
|
+
"@lit-protocol/vincent-contracts-sdk": "1.0.1"
|
|
58
58
|
},
|
|
59
59
|
"sideEffects": false,
|
|
60
60
|
"files": [
|