This is a ruby lib that allows to use the Frontegg API
To install using bundler:
gem 'frontegg', github: 'hinthealth/frontegg'
Frontegg.configure do |config|
config.client_id = 'your_client_id'
config.api_key = 'your_api_key'
config.log_enabled = false
end
Frontegg::User.new.create(
tenant_id:, # required
email:, # required
name:, # required
metadata:,
password:,
)
Frontegg::User.new.migrate_existing(
tenant_id:, # required
email:, # required
name:, # required
metadata:,
password_hash:,
mfa_code:,
)
Frontegg::User.new(frontegg_user_id).add_to_tenant(tenant_id)
Frontegg::User.new(frontegg_user_id).switch_tenant(tenant_id)
Frontegg::User.new(frontegg_user_id).delete(tenant_id:) # tenant is optional
Frontegg::User.new(frontegg_user_id).retrieve(tenant_id:) # tenant is optional
Frontegg::User.new(frontegg_user_id).make_superuser # tenant is optional
Frontegg::User.new(frontegg_user_id).verify
Frontegg::User.new(frontegg_user_id).expire_sessions(session_id) # session_id is optional
Frontegg::Tenant.new.create(
name:,
website: nil,
logo_url: nil,
metadata: {}
)
Frontegg::Tenant.new(frontegg_tenant_id).create(
name:,
website: nil,
logo_url: nil,
metadata: {}
)
Frontegg::Tenant.new(frontegg_tenant_id).retrieve
Frontegg::Tenant.new(frontegg_tenant_id).delete
Frontegg::Password.new.update(user_id:, password:, new_password:)
Frontegg::Password.new.create_reset_token(user_id:)
Frontegg::Password.new.reset_with_token(user_id:, token:, password:)
Frontegg::Mfa.new.update(user_id:)
Frontegg::Mfa.new.verify(token, user_id:)
Frontegg::Mfa.new.reset(user_id:)
Frontegg::Mfa.new.enforce(enforce, device_expiration:, tenant_id: nil)