stytch 10.34.0 → 10.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf7598087af09b0d588e884d87672f0372f9cff10e9ee3c40e09da96235e7942
4
- data.tar.gz: a585b3513151dd3a445d9e1c779c4c6f85ea20d026d287953041652dce62e8d2
3
+ metadata.gz: b5375f5cc73fc55e5a1ce59245ccc603c0a1016bd0b66a1345f66ed2cf1932e8
4
+ data.tar.gz: a0dc5c704106760e2933e5ecef5318f089cb6512833830a1d44daf386857c886
5
5
  SHA512:
6
- metadata.gz: 45dc31e2834a010646772fd2d4c03135ca757b9d30b12e0afee6753d4c42fb5e0eda6d34a6b5659e205893a181a1a919626016d5b9cce481a6d46eee38c9aaf0
7
- data.tar.gz: 2bbfd22c43f8d9457cefa6ca59025f4f0874d32e093e9b369abe2072816c7d2fc7ab881b84726be9cc6e7b65d3c2ebd55c92820878d582164e36ce81cdb5a60d
6
+ metadata.gz: d2e8fce4daaeb98021b3acbaa8fb934453c6a90659f25c1ab81568647b8363c1f1af0bfc22cbf6b787f03017094309ffa77d0d7596a7ed5d78ae419abd58a244
7
+ data.tar.gz: 3463bf3f5bde80a5bccbeffc482af33ed86f9beca239f9e8fe4b038a5380b6e5952e20ffb05316aca7fbc4fb84e602803f5a8559db9e10482385edad570eacff
@@ -33,11 +33,12 @@ module StytchB2B
33
33
 
34
34
  attr_reader :connected_app, :debug, :discovery, :fraud, :idp, :impersonation, :m2m, :magic_links, :oauth, :otps, :organizations, :passwords, :project, :rbac, :recovery_codes, :scim, :sso, :sessions, :totps
35
35
 
36
- def initialize(project_id:, secret:, env: nil, fraud_env: nil, &block)
36
+ def initialize(project_id:, secret:, env: nil, fraud_env: nil, timeout: nil, &block)
37
37
  @api_host = api_host(env, project_id)
38
38
  @fraud_api_host = fraud_api_host(fraud_env)
39
39
  @project_id = project_id
40
40
  @secret = secret
41
+ @timeout = timeout
41
42
  @is_b2b_client = true
42
43
 
43
44
  create_connection(&block)
@@ -108,7 +109,7 @@ module StytchB2B
108
109
  end
109
110
 
110
111
  def build_default_connection(builder)
111
- builder.options[:timeout] = Stytch::Middleware::NETWORK_TIMEOUT
112
+ builder.options[:timeout] = Stytch::Middleware.timeout(@timeout)
112
113
  builder.headers = Stytch::Middleware::NETWORK_HEADERS
113
114
  builder.request :json
114
115
  builder.use Stytch::Middleware
@@ -1522,10 +1522,12 @@ module StytchB2B
1522
1522
  # - Must not be in use by another member (retired emails count as used until they are [unlinked](https://stytch.com/docs/b2b/api/unlink-retired-member-email))
1523
1523
  # - Must not be updating for another member (i.e. two members cannot attempt to update to the same email at once)
1524
1524
  #
1525
- # The member will receive an Email Magic Link that expires in 5 minutes. If they do not verify their new email address in that timeframe, the email
1525
+ # The member will receive an Email Magic Link (or Email OTP Code, if `EMAIL_OTP` is specified as the delivery method) that expires in 5 minutes. If they do not verify their new email address in that timeframe, the email
1526
1526
  # will be freed up for other members to use.
1527
1527
  #
1528
- # The Magic Link will redirect to your `login_redirect_url` (or the configured default if one isn't provided), and you should invoke the [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal to complete the flow.
1528
+ # If using Email Magic Links, the magic link will redirect to your `login_redirect_url` (or the configured default if one isn't provided), and you should invoke the [Authenticate Magic Link](https://stytch.com/docs/b2b/api/authenticate-magic-link) endpoint as normal to complete the flow.
1529
+ #
1530
+ # If using Email OTP Codes, you should invoke the [Authenticate Email OTP Code](https://stytch.com/docs/b2b/api/authenticate-email-otp) endpoint as normal to complete the flow. Make sure to pass the new email address to the endpoint.
1529
1531
  #
1530
1532
  # == Parameters:
1531
1533
  # organization_id::
@@ -1554,6 +1556,9 @@ module StytchB2B
1554
1556
  # Use a custom template for login emails. By default, it will use your default email template. The template must be from Stytch's
1555
1557
  # built-in customizations or a custom HTML email for Magic Links - Login.
1556
1558
  # The type of this field is nilable +String+.
1559
+ # delivery_method::
1560
+ # The method that should be used to verify a member's new email address. The options are `EMAIL_MAGIC_LINK` or `EMAIL_OTP`. This field is optional, if no value is provided, `EMAIL_MAGIC_LINK` will be used.
1561
+ # The type of this field is nilable +StartEmailUpdateRequestDeliveryMethod+ (string enum).
1557
1562
  #
1558
1563
  # == Returns:
1559
1564
  # An object with the following fields:
@@ -1582,6 +1587,7 @@ module StytchB2B
1582
1587
  login_redirect_url: nil,
1583
1588
  locale: nil,
1584
1589
  login_template_id: nil,
1590
+ delivery_method: nil,
1585
1591
  method_options: nil
1586
1592
  )
1587
1593
  headers = {}
@@ -1592,6 +1598,7 @@ module StytchB2B
1592
1598
  request[:login_redirect_url] = login_redirect_url unless login_redirect_url.nil?
1593
1599
  request[:locale] = locale unless locale.nil?
1594
1600
  request[:login_template_id] = login_template_id unless login_template_id.nil?
1601
+ request[:delivery_method] = delivery_method unless delivery_method.nil?
1595
1602
 
1596
1603
  post_request("/v1/b2b/organizations/#{organization_id}/members/#{member_id}/start_email_update", request, headers)
1597
1604
  end
data/lib/stytch/client.rb CHANGED
@@ -31,11 +31,12 @@ module Stytch
31
31
 
32
32
  attr_reader :connected_app, :crypto_wallets, :debug, :fraud, :idp, :impersonation, :m2m, :magic_links, :oauth, :otps, :passwords, :project, :rbac, :sessions, :totps, :users, :webauthn
33
33
 
34
- def initialize(project_id:, secret:, env: nil, fraud_env: nil, &block)
34
+ def initialize(project_id:, secret:, env: nil, fraud_env: nil, timeout: nil, &block)
35
35
  @api_host = api_host(env, project_id)
36
36
  @fraud_api_host = fraud_api_host(fraud_env)
37
37
  @project_id = project_id
38
38
  @secret = secret
39
+ @timeout = timeout
39
40
  @is_b2b_client = false
40
41
 
41
42
  create_connection(&block)
@@ -104,7 +105,7 @@ module Stytch
104
105
  end
105
106
 
106
107
  def build_default_connection(builder)
107
- builder.options[:timeout] = Stytch::Middleware::NETWORK_TIMEOUT
108
+ builder.options[:timeout] = Stytch::Middleware.timeout(@timeout)
108
109
  builder.headers = Stytch::Middleware::NETWORK_HEADERS
109
110
  builder.request :json
110
111
  builder.use Stytch::Middleware
@@ -13,6 +13,10 @@ module Stytch
13
13
  'Content-Type' => 'application/json'
14
14
  }.freeze
15
15
 
16
- NETWORK_TIMEOUT = 300
16
+ NETWORK_TIMEOUT = 31
17
+
18
+ def self.timeout(custom_timeout = nil)
19
+ custom_timeout || NETWORK_TIMEOUT
20
+ end
17
21
  end
18
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stytch
4
- VERSION = '10.34.0'
4
+ VERSION = '10.36.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stytch
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.34.0
4
+ version: 10.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stytch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-24 00:00:00.000000000 Z
11
+ date: 2025-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday