Package com.vortexsoftware.sdk
Class VortexClient
java.lang.Object
com.vortexsoftware.sdk.VortexClient
Main Vortex SDK client for Java applications
Provides JWT generation and Vortex API integration with the same functionality
as the Node.js SDK, ensuring compatibility with React providers.
-
Constructor Summary
ConstructorsConstructorDescriptionVortexClient(String apiKey) Create a new Vortex client with the given API keyVortexClient(String apiKey, String baseUrl) Create a new Vortex client with custom base URL -
Method Summary
Modifier and TypeMethodDescriptionacceptInvitations(List<String> invitationIds, InvitationTarget target) Accept multiple invitations for a targetvoidclose()Close the HTTP client when donevoiddeleteInvitationsByGroup(String groupType, String groupId) Delete all invitations for a specific groupgenerateJwt(Map<String, Object> params) Generate a JWT using the same algorithm as the Node.js SDKgetInvitation(String invitationId) Get a specific invitation by IDgetInvitationsByGroup(String groupType, String groupId) Get all invitations for a specific groupgetInvitationsByTarget(String targetType, String targetValue) Get invitations by target (email, username, phoneNumber)Reinvite a user (send invitation again)voidrevokeInvitation(String invitationId) Revoke (delete) an invitation
-
Constructor Details
-
VortexClient
Create a new Vortex client with the given API key -
VortexClient
Create a new Vortex client with custom base URL
-
-
Method Details
-
generateJwt
Generate a JWT using the same algorithm as the Node.js SDKThis replicates the exact JWT generation process from vortex.ts to ensure complete compatibility with React providers.
Simple usage:
Map<String, Object> params = new HashMap<>(); User user = new User("user-123", "user@example.com"); user.setAdminScopes(Arrays.asList("autoJoin")); params.put("user", user); String jwt = client.generateJwt(params);With additional properties:
Map<String, Object> params = new HashMap<>(); User user = new User("user-123", "user@example.com"); params.put("user", user); params.put("role", "admin"); params.put("department", "Engineering"); String jwt = client.generateJwt(params);- Parameters:
params- Map containing "user" key with User object and optional additional properties- Returns:
- JWT token
- Throws:
VortexException- if JWT generation fails
-
getInvitationsByTarget
public List<InvitationResult> getInvitationsByTarget(String targetType, String targetValue) throws VortexException Get invitations by target (email, username, phoneNumber)- Throws:
VortexException
-
getInvitation
Get a specific invitation by ID- Throws:
VortexException
-
revokeInvitation
Revoke (delete) an invitation- Throws:
VortexException
-
acceptInvitations
public List<InvitationResult> acceptInvitations(List<String> invitationIds, InvitationTarget target) throws VortexException Accept multiple invitations for a target- Throws:
VortexException
-
deleteInvitationsByGroup
Delete all invitations for a specific group- Throws:
VortexException
-
getInvitationsByGroup
public List<InvitationResult> getInvitationsByGroup(String groupType, String groupId) throws VortexException Get all invitations for a specific group- Throws:
VortexException
-
reinvite
Reinvite a user (send invitation again)- Throws:
VortexException
-
close
public void close()Close the HTTP client when done
-