Skip to main content
Vortex handles the complete invitation lifecycle — sending invites via email/SMS/share links, tracking clicks and conversions, managing referral programs, and optimizing your invitation flows with A/B testing.

Installation

gem install vortex-ruby-sdk

Quick Start

Generate a secure token for Vortex components
require 'vortex'

client = Vortex::Client.new(ENV['VORTEX_API_KEY'])

# Generate a token for the current user
token = client.generate_token(user: { id: 'user-123', email: 'user@example.com' })

# Pass the token to your frontend component

Integration Flow

Vortex uses a split architecture: your backend signs tokens with the SDK, and your frontend renders components that use those tokens to securely interact with Vortex.
1

Install the backend SDK

Add this SDK to your Ruby project
gem 'vortex-ruby-sdk'
2

Initialize the client

Create a Vortex client with your API key (keep this on the server!)
require 'vortex'

client = Vortex::Client.new(ENV['VORTEX_API_KEY'])
3

Generate a token for the current user

When a user loads a page with a Vortex component, generate a signed token on your server
token = client.generate_token(user: { id: current_user.id })
4

Pass the token to your frontend

Include the token in your page response or API response
render json: { vortex_token: token }
5

Render a Vortex component with the token

Use the React/Angular/Web Component with the token
import { VortexInvite } from "@teamvortexsoftware/vortex-react";

<VortexInvite token={vortexToken} />
6

Vortex handles the rest

The component securely communicates with Vortex servers, displays the invitation UI, sends emails/SMS, tracks conversions, and reports analytics

Methods

Core Methods

generate_token()

Generate a signed token for use with Vortex widgets. This method generates a signed JWT token containing your payload data. The token can be passed to widgets via the token prop to authenticate and authorize the request.
generate_token(payload, options = nil)
Parameters:
NameTypeRequiredDescription
payloadHashData to sign (user, component, scope, vars, etc.)
optionsHashOptional configuration
Returns: String — Signed JWT token
#   token = client.generate_token({ user: { id: 'user-123' } })
    #
    #   token = client.generate_token({
    #     component: 'widget-abc',
    #     user: { id: 'user-123', name: 'Peter', email: 'peter@example.com' },
    #     scope: 'workspace_456',
    #     vars: { company_name: 'Acme' }
    #   })
    #
    #   token = client.generate_token(payload, { expires_in: '1h' })
    #   token = client.generate_token(payload, { expires_in: 3600 }) # seconds

get_invitation()

Get a specific invitation by ID
get_invitation(invitation_id)
Parameters:
NameTypeRequiredDescription
invitation_idStringThe invitation ID
Returns: String — The invitation data

accept_invitation()

Accept a single invitation (recommended method) This is the recommended method for accepting invitations.
accept_invitation(invitation_id, user)
Parameters:
NameTypeRequiredDescription
invitation_idStringSingle invitation ID to accept
userHashUser hash with :email and/or :phone
Returns: String — The accepted invitation result
#   user = { email: 'user@example.com', name: 'John Doe' }
    #   result = client.accept_invitation('inv-123', user)

get_invitations_by_target()

Get invitations by target
get_invitations_by_target(target_type, target_value)
Parameters:
NameTypeRequiredDescription
target_typeStringType of target (email, sms)
target_valueStringValue of target (email address, phone number)
Returns: String — List of invitations

revoke_invitation()

Revoke (delete) an invitation
revoke_invitation(invitation_id)
Parameters:
NameTypeRequiredDescription
invitation_idStringThe invitation ID to revoke
Returns: String — Success response

accept_invitations()

Accept invitations using the new User format (preferred) Supports three formats: 1. User hash (preferred): { email: ’…’, phone: ’…’, name: ’…’ } 2. Target hash (deprecated): { type: ‘email’, value: ’…’ } 3. Array of targets (deprecated): [{ type: ‘email’, value: ’…’ }, …]
accept_invitations(invitation_ids, user_or_target)
Parameters:
NameTypeRequiredDescription
invitation_idsArray&lt;String&gt;List of invitation IDs to accept
user_or_targetHash, ArrayUser hash with :email/:phone/:name keys, OR legacy target(s)
Returns: String — The accepted invitation result
#   user = { email: 'user@example.com', name: 'John Doe' }
    #   result = client.accept_invitations(['inv-123'], user)
    #
    #   target = { type: 'email', value: 'user@example.com' }
    #   result = client.accept_invitations(['inv-123'], target)

get_invitations_by_scope()

Get invitations by group
get_invitations_by_scope(scope_type, scope)
Parameters:
NameTypeRequiredDescription
scope_typeStringThe group type
scopeStringThe group ID
Returns: String — List of invitations for the group

delete_invitations_by_scope()

Delete invitations by group
delete_invitations_by_scope(scope_type, scope)
Parameters:
NameTypeRequiredDescription
scope_typeStringThe group type
scopeStringThe group ID
Returns: String — Success response

reinvite()

Reinvite a user
reinvite(invitation_id)
Parameters:
NameTypeRequiredDescription
invitation_idStringThe invitation ID to reinvite
Returns: String — The reinvited invitation result

get_autojoin_domains()

Get autojoin domains configured for a specific scope
get_autojoin_domains(scope_type, scope)
Parameters:
NameTypeRequiredDescription
scope_typeStringThe type of scope (e.g., “organization”, “team”, “project”)
scopeStringThe scope identifier (customer’s group ID)
Returns: String — Response with :autojoin_domains array and :invitation
#   result = client.get_autojoin_domains('organization', 'acme-org')
    #   result['autojoinDomains'].each do |domain|
    #     puts "Domain: #{domain['domain']}"
    #   end

configure_autojoin()

Configure autojoin domains for a specific scope This endpoint syncs autojoin domains - it will add new domains, remove domains not in the provided list, and deactivate the autojoin invitation if all domains are removed (empty array).
configure_autojoin(scope, scope_type, domains, component_id, scope_name = nil, metadata = nil)
Parameters:
NameTypeRequiredDescription
scopeStringThe scope identifier (customer’s group ID)
scope_typeStringThe type of scope (e.g., “organization”, “team”)
domainsArray&lt;String&gt;Array of domains to configure for autojoin
component_idStringThe component ID
scope_nameString, nilOptional display name for the scope
metadataHash, nilOptional metadata to attach to the invitation
Returns: String — Response with :autojoin_domains array and :invitation
#   result = client.configure_autojoin(
    #     'acme-org',
    #     'organization',
    #     ['acme.com', 'acme.org'],
    #     'component-123',
    #     'Acme Corporation'
    #   )

Types

GenerateTokenPayload

Payload for generate_token() - used to generate secure tokens for Vortex components
FieldTypeRequiredDescription
userHash (TokenUser)The authenticated user who will be using the Vortex component
componentStringComponent ID to generate token for (from your Vortex dashboard)
scopeStringScope identifier to restrict invitations (format: “scopeType:scopeId”)
varsHashCustom variables to pass to the component for template rendering

TokenUser

User data for token generation - represents the authenticated user sending invitations
FieldTypeRequiredDescription
idStringUnique identifier for the user in your system. Used to attribute invitations.
emailStringUser’s email address. Used for reply-to in invitation emails.
nameStringDisplay name shown to invitation recipients (e.g., “John invited you”)
avatar_urlStringURL to user’s avatar image. Displayed in invitation emails and widgets.
admin_scopesArray&lt;String&gt;List of scope IDs where this user has admin privileges
allowed_email_domainsArray&lt;String&gt;Restrict invitations to specific email domains (e.g., [“acme.com”])

AcceptUser

User data for accepting invitations - identifies who accepted the invitation
FieldTypeRequiredDescription
emailStringEmail address of the accepting user. At least one of email or phone is required.
phoneStringPhone number with country code. At least one of email or phone is required.
nameStringDisplay name of the accepting user (shown in notifications to inviter)
is_existingBooleanWhether user was already registered. true=existing, false=new signup, nil=unknown.

CreateInvitationTarget

Target specification when creating an invitation - where to send the invite
FieldTypeRequiredDescription
typeStringDelivery channel: “email”, “phone”, “share”, or “internal”
valueStringTarget address: email address, phone number with country code, or internal user ID
nameStringDisplay name of the recipient (used in email greetings)

CreateInvitationScope

Scope specification when creating an invitation - what group/team to invite into
FieldTypeRequiredDescription
typeStringScope type (e.g., “team”, “organization”, “workspace”)
group_idStringYour internal identifier for this scope/group
nameStringDisplay name for the scope (shown in invitation emails)

Identifier

Email or phone identifier for looking up users
FieldTypeRequiredDescription
typeStringIdentifier type: “email” or “phone”
valueStringThe email address or phone number (with country code for phone)

ConfigureAutojoinRequest

Request to configure autojoin domains for a scope
FieldTypeRequiredDescription
scope_typeStringType of scope (e.g., “team”, “workspace”)
scope_idStringYour internal identifier for the scope
domainsArray&lt;String&gt;List of email domains to enable autojoin for (e.g., [“acme.com”])

SyncInternalInvitationRequest

Request to sync an internal invitation (for tracking invitations made outside Vortex)
FieldTypeRequiredDescription
inviter_idStringYour internal user ID for the person who sent the invitation
targetHash (CreateInvitationTarget)The invitation recipient
scopesArray&lt;Hash&gt;Scopes/groups the invitation grants access to

InvitationResult

Complete invitation details as returned by the Vortex API
FieldTypeRequiredDescription
idStringUnique identifier for this invitation
account_idStringYour Vortex account ID
click_throughsIntegerNumber of times the invitation link was clicked
created_atStringISO 8601 timestamp when the invitation was created
deactivatedBooleanWhether this invitation has been revoked or expired
delivery_countIntegerNumber of times the invitation was sent (including reminders)
delivery_typesArray&lt;String&gt;Channels used to deliver: “email”, “phone”, “share”, “internal”
foreign_creator_idStringYour internal user ID for the person who created this invitation
invitation_typeStringType: “single_use”, “multi_use”, or “autojoin”
statusStringCurrent status: queued, sending, sent, delivered, accepted, shared
targetArray&lt;Hash&gt;List of invitation recipients with their contact info and status
viewsIntegerNumber of times the invitation page was viewed
groupsArray&lt;Hash&gt;Scopes (teams/orgs) this invitation grants access to
expiredBooleanWhether this invitation has passed its expiration date
expiresStringISO 8601 timestamp when this invitation expires
inviterHash (Inviter)Information about who sent the invitation

InvitationTarget

Target recipient of an invitation (from API response)
FieldTypeRequiredDescription
typeStringDelivery channel: “email”, “phone”, “share”, or “internal”
valueStringTarget address: email, phone number with country code, or share link ID
nameStringDisplay name of the recipient
avatar_urlStringAvatar URL for the recipient
statusStringDelivery status for this specific target

InvitationScope

Scope/group that the invitation grants access to (from API response)
FieldTypeRequiredDescription
idStringVortex internal UUID for this scope record
account_idStringYour Vortex account ID
group_idStringYour internal scope/group identifier
typeStringScope type (e.g., “team”, “organization”, “workspace”)
nameStringDisplay name for the scope
created_atStringISO 8601 timestamp when the scope was created

InvitationAcceptance

Details about an invitation acceptance event
FieldTypeRequiredDescription
idStringUnique identifier for this acceptance record
invitation_idStringID of the invitation that was accepted
emailStringEmail of the user who accepted
phoneStringPhone of the user who accepted
nameStringName of the user who accepted
is_existingBooleanWhether the user already had an account
created_atStringISO 8601 timestamp when the acceptance occurred

Inviter

Information about the user who sent an invitation
FieldTypeRequiredDescription
idStringYour internal user ID for the inviter
emailStringEmail address of the inviter
nameStringDisplay name of the inviter
avatar_urlStringAvatar URL of the inviter

AutojoinDomain

Autojoin domain configuration - users with matching email domains automatically join
FieldTypeRequiredDescription
idStringUnique identifier for this autojoin configuration
domainStringEmail domain that triggers autojoin (e.g., “acme.com”)

AutojoinDomainsResponse

Response from get_autojoin_domains()
FieldTypeRequiredDescription
domainsArray&lt;AutojoinDomain&gt;List of configured autojoin domains

SyncInternalInvitationResponse

Response from sync_internal_invitation()
FieldTypeRequiredDescription
invitationHash (InvitationResult)The created or updated invitation
createdBooleantrue if a new invitation was created, false if existing was updated

VortexWebhookEvent

Webhook event payload delivered to your endpoint
FieldTypeRequiredDescription
idStringUnique identifier for this webhook delivery
typeStringEvent type (e.g., “invitation.accepted”, “member.created”)
timestampStringISO 8601 timestamp when the event occurred
dataHashEvent-specific payload data

Webhooks

Webhooks let your server receive real-time notifications when events happen in Vortex. Use them to sync invitation state with your database, trigger onboarding flows, update your CRM, or send internal notifications.

Setup

  1. Go to your Vortex dashboard → Integrations → Webhooks tab
  2. Click “Add Webhook”
  3. Enter your endpoint URL (must be HTTPS in production)
  4. Copy the signing secret — you’ll use this to verify webhook signatures
  5. Select which events you want to receive

Example

Rails webhook handler
class WebhooksController < ApplicationController
  skip_before_action :verify_authenticity_token

  def vortex
    webhooks = Vortex::Webhooks.new(ENV['VORTEX_WEBHOOK_SECRET'])
    
    payload = request.raw_post
    signature = request.headers['X-Vortex-Signature']
    
    # Verify the signature
    unless webhooks.verify_signature(payload, signature)
      return render json: { error: 'Invalid signature' }, status: 400
    end
    
    # Parse the event
    event = webhooks.parse_event(payload)
    
    case event['type']
    when 'invitation.accepted'
      # User accepted an invitation — activate their account
      Rails.logger.info "Accepted: #{event['data']}"
    when 'member.created'
      # New member joined via invitation
      Rails.logger.info "New member: #{event['data']}"
    end
    
    render json: { received: true }
  end
end

Events

EventDescription
invitation.createdA new invitation was created
invitation.acceptedAn invitation was accepted by the recipient
invitation.deactivatedAn invitation was deactivated (revoked or expired)
invitation.email.deliveredInvitation email was successfully delivered
invitation.email.bouncedInvitation email bounced (invalid address)
invitation.email.openedRecipient opened the invitation email
invitation.link.clickedRecipient clicked the invitation link
invitation.reminder.sentA reminder email was sent for a pending invitation
member.createdA new member was created from an accepted invitation
group.member.addedA member was added to a scope/group
deployment.createdA new deployment configuration was created
deployment.deactivatedA deployment was deactivated
abtest.startedAn A/B test was started
abtest.winner_declaredAn A/B test winner was declared
email.complainedRecipient marked the email as spam

Use Cases

  • Activate users on acceptance — When invitation.accepted fires, mark the user as active in your database and trigger your onboarding flow.
  • Track invitation performance — Monitor email.delivered, email.opened, and link.clicked events to measure invitation funnel metrics.
  • Sync team membership — Use member.created and group.member.added to keep your internal membership records in sync.
  • Alert on delivery issues — Watch for email.bounced events to proactively reach out via alternative channels.

Error Handling

ErrorDescription
VortexErrorRaised for validation errors (e.g., missing API key, invalid parameters) or API failures

Resources