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 from API responses
InvitationsResponse
Response containing multiple invitations
Inviter
Information about the user creating the invitation (the inviter)
UnfurlConfig
Configuration for link unfurl (Open Graph) metadata Controls how the invitation link appears when shared on social platforms or messaging apps
User
User type for JWT generation Optional fields: user_name (max 200 chars), user_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
CreateInvitationTargetType
Target type for creating invitations
DeliveryType
Delivery type for invitations
InvitationStatus
Current status of an invitation
InvitationTargetType
Target type for invitation responses (who was invited)
InvitationType
Type of invitation
UnfurlOgType
Valid Open Graph types for unfurl configuration
VortexError
Error types for Vortex SDK operations