@teamvortexsoftware/vortex-nextjs-15-sdk 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -215,6 +215,33 @@ const { data: invitations } = useFetch('/api/vortex/invitations/by-group/team/my
|
|
|
215
215
|
await fetch(`/api/vortex/invitations/${invitationId}`, { method: 'DELETE' });
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
+
### Sync Internal Invitation
|
|
219
|
+
|
|
220
|
+
If you're using `internal` delivery type invitations and managing the invitation flow within your own application, you can sync invitation decisions back to Vortex when users accept or decline invitations in your system.
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
// Sync an internal invitation action (accept or decline)
|
|
224
|
+
const response = await fetch('/api/vortex/invitation-actions/sync-internal-invitation', {
|
|
225
|
+
method: 'POST',
|
|
226
|
+
headers: { 'Content-Type': 'application/json' },
|
|
227
|
+
body: JSON.stringify({
|
|
228
|
+
creatorId: 'user-123', // The inviter's user ID in your system
|
|
229
|
+
targetValue: 'user-456', // The invitee's user ID in your system
|
|
230
|
+
action: 'accepted', // "accepted" or "declined"
|
|
231
|
+
componentId: 'component-uuid' // The widget component UUID
|
|
232
|
+
})
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
const result = await response.json();
|
|
236
|
+
// result.processed - Number of invitations processed
|
|
237
|
+
// result.invitationIds - Array of processed invitation IDs
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Use cases:**
|
|
241
|
+
- You handle invitation delivery through your own in-app notifications or UI
|
|
242
|
+
- Users accept/decline invitations within your application
|
|
243
|
+
- You need to keep Vortex updated with the invitation status
|
|
244
|
+
|
|
218
245
|
### Backend: Direct SDK Usage
|
|
219
246
|
|
|
220
247
|
```typescript
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@teamvortexsoftware/vortex-nextjs-15-sdk",
|
|
3
3
|
"description": "Drop-in Next.js module for Vortex API integration",
|
|
4
4
|
"author": "@teamvortexsoftware",
|
|
5
|
-
"version": "0.4.
|
|
5
|
+
"version": "0.4.2",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typescript-eslint": "8.50.1"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@teamvortexsoftware/vortex-node-22-sdk": "^0.8.
|
|
45
|
+
"@teamvortexsoftware/vortex-node-22-sdk": "^0.8.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"next": ">=13.0.0"
|