Skip to main content

Crate vortex_sdk

Crate vortex_sdk 

Source
Expand description

Vortex Rust SDK

This crate provides a Rust SDK for the Vortex authentication and invitation management platform.

§Features

  • Generate JWTs compatible with React providers
  • Full API integration for invitation management
  • Async/await support with tokio
  • Type-safe API with comprehensive error handling

§Example

use vortex_sdk::{VortexClient, User};

#[tokio::main]
async fn main() {
    let client = VortexClient::new(std::env::var("VORTEX_API_KEY").unwrap());

    // Generate a JWT
    let user = User::new("user-123", "user@example.com")
        .with_admin_scopes(vec!["autojoin".to_string()]);
    let jwt = client.generate_jwt(&user, None).unwrap();

    println!("JWT: {}", jwt);

    // Get invitations
    let invitations = client
        .get_invitations_by_target("email", "user@example.com")
        .await
        .unwrap();

    println!("Found {} invitations", invitations.len());
}

Structs§

AcceptUser
User data for accepting invitations (preferred format)
CreateInvitationGroup
Group information for creating invitations
CreateInvitationRequest
Request body for creating an invitation
CreateInvitationResponse
Response from creating an invitation
CreateInvitationTarget
Target for creating an invitation
Group
Group information for JWT generation (input) Supports both ‘id’ (legacy) and ‘groupId’ (preferred) for backward compatibility
Identifier
Identifier for a user (email, sms, etc.)
Invitation
Full invitation details
InvitationAcceptance
Invitation acceptance information
InvitationGroup
Invitation group from API responses This matches the MemberGroups table structure from the API
InvitationTarget
Invitation target (email or sms) - DEPRECATED Use AcceptUser instead for accepting invitations
InvitationsResponse
Response containing multiple invitations
Inviter
Information about the user creating the invitation (the inviter)
User
User type for JWT generation Optional fields: name (max 200 chars), avatar_url (HTTPS URL, max 2000 chars), admin_scopes
VortexClient
Vortex Rust SDK Client

Enums§

AcceptInvitationParam
Accept invitation parameter - supports both new User format and legacy Target format
VortexError
Error types for Vortex SDK operations