Module: Vortex
- Defined in:
- lib/vortex.rb,
lib/vortex/error.rb,
lib/vortex/rails.rb,
lib/vortex/types.rb,
lib/vortex/client.rb,
lib/vortex/sinatra.rb,
lib/vortex/version.rb,
lib/vortex/webhooks.rb,
lib/vortex/webhook_types.rb
Overview
Vortex Ruby SDK
This gem provides a Ruby interface to the Vortex invitation system, with the same functionality and API compatibility as other Vortex SDKs (Node.js, Python, Java, Go).
Features:
-
JWT generation with identical algorithm to other SDKs
-
Complete invitation management API
-
Rails and Sinatra framework integrations
-
Same route structure for React provider compatibility
Basic usage:
require 'vortex'
client = Vortex::Client.new(ENV['VORTEX_API_KEY'])
jwt = client.generate_jwt(
user_id: 'user123',
identifiers: [{ type: 'email', value: '[email protected]' }],
groups: [{ id: 'team1', type: 'team', name: 'Engineering' }],
role: 'admin'
)
Framework integrations:
# Rails
require 'vortex/rails'
# Sinatra
require 'vortex/sinatra'
Defined Under Namespace
Modules: AnalyticsEventTypes, Rails, Sinatra, Types, WebhookEventTypes Classes: AnalyticsEvent, Client, VortexError, WebhookEvent, WebhookSignatureError, Webhooks
Constant Summary collapse
- VERSION =
'1.9.0'
Class Method Summary collapse
-
.analytics_event?(parsed) ⇒ Boolean
Returns true if the parsed hash is an analytics event.
-
.new(api_key, base_url: nil) ⇒ Vortex::Client
Create a new Vortex client instance.
-
.version ⇒ String
Get the current version of the SDK.
-
.webhook_event?(parsed) ⇒ Boolean
Returns true if the parsed hash is a webhook event.
Class Method Details
.analytics_event?(parsed) ⇒ Boolean
Returns true if the parsed hash is an analytics event
108 109 110 |
# File 'lib/vortex/webhook_types.rb', line 108 def self.analytics_event?(parsed) parsed.key?('name') end |
.new(api_key, base_url: nil) ⇒ Vortex::Client
Create a new Vortex client instance
47 48 49 |
# File 'lib/vortex.rb', line 47 def new(api_key, base_url: nil) Client.new(api_key, base_url: base_url) end |
.version ⇒ String
Get the current version of the SDK
54 55 56 |
# File 'lib/vortex.rb', line 54 def version VERSION end |
.webhook_event?(parsed) ⇒ Boolean
Returns true if the parsed hash is a webhook event
103 104 105 |
# File 'lib/vortex/webhook_types.rb', line 103 def self.webhook_event?(parsed) parsed.key?('type') && !parsed.key?('name') end |