Class VortexClient

java.lang.Object
com.vortexsoftware.sdk.VortexClient

public class VortexClient extends Object
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 Details

    • VortexClient

      public VortexClient(String apiKey)
      Create a new Vortex client with the given API key
    • VortexClient

      public VortexClient(String apiKey, String baseUrl)
      Create a new Vortex client with custom base URL
  • Method Details

    • generateJwt

      public String generateJwt(Map<String,Object> params) throws VortexException
      Generate a JWT using the same algorithm as the Node.js SDK

      This 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

      public InvitationResult getInvitation(String invitationId) throws VortexException
      Get a specific invitation by ID
      Throws:
      VortexException
    • revokeInvitation

      public void revokeInvitation(String invitationId) throws VortexException
      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

      public void deleteInvitationsByGroup(String groupType, String groupId) throws VortexException
      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

      public InvitationResult reinvite(String invitationId) throws VortexException
      Reinvite a user (send invitation again)
      Throws:
      VortexException
    • close

      public void close()
      Close the HTTP client when done