Class: Seam::Resources::ClientSession
- Inherits:
-
BaseResource
- Object
- BaseResource
- Seam::Resources::ClientSession
- Defined in:
- lib/seam/resources/client_session.rb
Overview
Represents a client session. If you want to restrict your users' access to their own devices, use client sessions.
You create each client session with a custom user_identifier_key. Normally, the user_identifier_key is a user ID that your application provides.
When calling the Seam API from your backend using an API key, you can pass the user_identifier_key as a parameter to limit results to the associated client session. For example, /devices/list?user_identifier_key=123 only returns devices associated with the client session created with the user_identifier_key 123.
A client session has a token that you can use with the Seam JavaScript SDK to make requests from the client (browser) directly to the Seam API. The token restricts the user's access to only the devices that they own.
See also Get Started with React.
Instance Attribute Summary collapse
-
#client_session_id ⇒ String
ID of the client session.
-
#connect_webview_ids ⇒ Array<String>
IDs of the Connect Webviews associated with the client session.
-
#connected_account_ids ⇒ Array<String>
IDs of the connected accounts associated with the client session.
-
#customer_key ⇒ String?
Customer key associated with the client session.
-
#device_count ⇒ Float
Number of devices associated with the client session.
-
#token ⇒ String
Client session token associated with the client session.
-
#user_identifier_key ⇒ String?
Your user ID for the user associated with the client session.
-
#user_identity_id ⇒ String?
ID of the user identity associated with the client session.
-
#user_identity_ids ⇒ Array<String>
deprecated
Deprecated.
Use
user_identity_idinstead. -
#workspace_id ⇒ String
ID of the workspace associated with the client session.
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#created_at ⇒ Time
Date and time at which the client session was created.
-
#expires_at ⇒ Time
Date and time at which the client session expires.
Methods inherited from BaseResource
#[], date_accessor, #initialize, #inspect, load_from_response, resource_accessor, resource_accessors, resource_list_accessor, resource_list_accessors, #update_from_response
Constructor Details
This class inherits a constructor from Seam::Resources::BaseResource
Instance Attribute Details
#client_session_id ⇒ String
ID of the client session.
17 18 19 |
# File 'lib/seam/resources/client_session.rb', line 17 def client_session_id @client_session_id end |
#connect_webview_ids ⇒ Array<String>
IDs of the Connect Webviews associated with the client session.
20 21 22 |
# File 'lib/seam/resources/client_session.rb', line 20 def connect_webview_ids @connect_webview_ids end |
#connected_account_ids ⇒ Array<String>
IDs of the connected accounts associated with the client session.
23 24 25 |
# File 'lib/seam/resources/client_session.rb', line 23 def connected_account_ids @connected_account_ids end |
#customer_key ⇒ String?
Customer key associated with the client session.
26 27 28 |
# File 'lib/seam/resources/client_session.rb', line 26 def customer_key @customer_key end |
#device_count ⇒ Float
Number of devices associated with the client session.
29 30 31 |
# File 'lib/seam/resources/client_session.rb', line 29 def device_count @device_count end |
#token ⇒ String
Client session token associated with the client session.
32 33 34 |
# File 'lib/seam/resources/client_session.rb', line 32 def token @token end |
#user_identifier_key ⇒ String?
Your user ID for the user associated with the client session.
35 36 37 |
# File 'lib/seam/resources/client_session.rb', line 35 def user_identifier_key @user_identifier_key end |
#user_identity_id ⇒ String?
ID of the user identity associated with the client session.
38 39 40 |
# File 'lib/seam/resources/client_session.rb', line 38 def user_identity_id @user_identity_id end |
#user_identity_ids ⇒ Array<String>
Use user_identity_id instead.
IDs of the user identities associated with the client session.
42 43 44 |
# File 'lib/seam/resources/client_session.rb', line 42 def user_identity_ids @user_identity_ids end |
#workspace_id ⇒ String
ID of the workspace associated with the client session.
45 46 47 |
# File 'lib/seam/resources/client_session.rb', line 45 def workspace_id @workspace_id end |
Instance Method Details
#created_at ⇒ Time
Date and time at which the client session was created.
49 |
# File 'lib/seam/resources/client_session.rb', line 49 date_accessor :created_at |
#expires_at ⇒ Time
Date and time at which the client session expires.
53 |
# File 'lib/seam/resources/client_session.rb', line 53 date_accessor :expires_at |