Vortex Rust SDK
This crate provides the Vortex Rust SDK for authentication and invitation management.
With this SDK, you can generate JWTs for use with the Vortex Widget and make API calls to the Vortex API.
Features
Invitation Delivery Types
Vortex supports multiple delivery methods for invitations:
email- Email invitations sent by Vortex (includes reminders and nudges)phone- Phone invitations sent by the user/customershare- Shareable invitation links for social sharinginternal- Internal invitations managed entirely by your application- No email/SMS communication triggered by Vortex
- Target value can be any customer-defined identifier (UUID, string, number)
- Useful for in-app invitation flows where you handle the delivery
- Example use case: In-app notifications, dashboard invites, etc.
Installation
Add the SDK to your Cargo.toml:
[]
= "1.0"
= { = "1.0", = ["full"] }
Getting Started
Once you have the SDK installed, login to Vortex and create an API Key. Keep your API key safe! Vortex does not store the API key and it is not retrievable once it has been created.
Your API key is used to:
- Sign JWTs for use with the Vortex Widget
- Make API calls against the Vortex API
Usage
Generate a JWT for the Vortex Widget
The Vortex Widget requires a JWT to authenticate users. Here's how to generate one:
use ;
Async API Usage
All API methods are async and require a tokio runtime:
use ;
async
Using with Axum (Web Framework)
Here's an example of using the SDK with the Axum web framework:
use ;
use ;
use Arc;
use VortexClient;
async
async
API Methods
All API methods are asynchronous and require the tokio runtime.
Invitation Management
Get Invitations by Target
let invitations = client
.get_invitations_by_target
.await?;
Get Invitation by ID
let invitation = client.get_invitation.await?;
Revoke Invitation
client.revoke_invitation.await?;
Accept Invitations
use InvitationTarget;
let target = new;
let result = client
.accept_invitations
.await?;
Get Invitations by Group
let invitations = client
.get_invitations_by_group
.await?;
Delete Invitations by Group
client
.delete_invitations_by_group
.await?;
Reinvite
let result = client.reinvite.await?;
Error Handling
The SDK uses a custom VortexError type for error handling:
use ;
match client.get_invitation.await
Requirements
- Rust 1.70 or higher
- Tokio runtime for async operations
Features
- Type-safe: Full type safety with Rust's type system
- Async/await: Built on tokio for efficient async operations
- React Compatible: JWTs generated using the same algorithm as Node.js SDK
- Comprehensive: All Vortex API endpoints supported
- Error handling: Rich error types for better debugging
- Flexible: User-based JWT generation with support for admin scopes and custom properties
License
MIT
Support
For support, please contact support@vortexsoftware.com or visit our documentation.