Class: Stytch::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/stytch/client.rb

Constant Summary collapse

ENVIRONMENTS =
%i[live test].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_id:, secret:, env: nil, &block) ⇒ Client

Returns a new instance of Client.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/stytch/client.rb', line 21

def initialize(project_id:, secret:, env: nil, &block)
  @api_host   = api_host(env, project_id)
  @project_id = project_id
  @secret     = secret

  create_connection(&block)

  @crypto_wallets = Stytch::CryptoWallets.new(@connection)
  @m2m = Stytch::M2M.new(@connection, @project_id)
  @magic_links = Stytch::MagicLinks.new(@connection)
  @oauth = Stytch::OAuth.new(@connection)
  @otps = Stytch::OTPs.new(@connection)
  @passwords = Stytch::Passwords.new(@connection)
  @project = Stytch::Project.new(@connection)
  @sessions = Stytch::Sessions.new(@connection, @project_id)
  @totps = Stytch::TOTPs.new(@connection)
  @users = Stytch::Users.new(@connection)
  @webauthn = Stytch::WebAuthn.new(@connection)
end

Instance Attribute Details

#crypto_walletsObject (readonly)

Returns the value of attribute crypto_wallets.



19
20
21
# File 'lib/stytch/client.rb', line 19

def crypto_wallets
  @crypto_wallets
end

#m2mObject (readonly)

Returns the value of attribute m2m.



19
20
21
# File 'lib/stytch/client.rb', line 19

def m2m
  @m2m
end

Returns the value of attribute magic_links.



19
20
21
# File 'lib/stytch/client.rb', line 19

def magic_links
  @magic_links
end

#oauthObject (readonly)

Returns the value of attribute oauth.



19
20
21
# File 'lib/stytch/client.rb', line 19

def oauth
  @oauth
end

#otpsObject (readonly)

Returns the value of attribute otps.



19
20
21
# File 'lib/stytch/client.rb', line 19

def otps
  @otps
end

#passwordsObject (readonly)

Returns the value of attribute passwords.



19
20
21
# File 'lib/stytch/client.rb', line 19

def passwords
  @passwords
end

#projectObject (readonly)

Returns the value of attribute project.



19
20
21
# File 'lib/stytch/client.rb', line 19

def project
  @project
end

#sessionsObject (readonly)

Returns the value of attribute sessions.



19
20
21
# File 'lib/stytch/client.rb', line 19

def sessions
  @sessions
end

#totpsObject (readonly)

Returns the value of attribute totps.



19
20
21
# File 'lib/stytch/client.rb', line 19

def totps
  @totps
end

#usersObject (readonly)

Returns the value of attribute users.



19
20
21
# File 'lib/stytch/client.rb', line 19

def users
  @users
end

#webauthnObject (readonly)

Returns the value of attribute webauthn.



19
20
21
# File 'lib/stytch/client.rb', line 19

def webauthn
  @webauthn
end