Class: Seam::Resources::ClientSession

Inherits:
BaseResource show all
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

Attributes inherited from BaseResource

#client, #data

Instance Method Summary collapse

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_idString

ID of the client session.

Returns:

  • (String)


17
18
19
# File 'lib/seam/resources/client_session.rb', line 17

def client_session_id
  @client_session_id
end

#connect_webview_idsArray<String>

IDs of the Connect Webviews associated with the client session.

Returns:

  • (Array<String>)


20
21
22
# File 'lib/seam/resources/client_session.rb', line 20

def connect_webview_ids
  @connect_webview_ids
end

#connected_account_idsArray<String>

IDs of the connected accounts associated with the client session.

Returns:

  • (Array<String>)


23
24
25
# File 'lib/seam/resources/client_session.rb', line 23

def 
  @connected_account_ids
end

#customer_keyString?

Customer key associated with the client session.

Returns:

  • (String, nil)


26
27
28
# File 'lib/seam/resources/client_session.rb', line 26

def customer_key
  @customer_key
end

#device_countFloat

Number of devices associated with the client session.

Returns:

  • (Float)


29
30
31
# File 'lib/seam/resources/client_session.rb', line 29

def device_count
  @device_count
end

#tokenString

Client session token associated with the client session.

Returns:

  • (String)


32
33
34
# File 'lib/seam/resources/client_session.rb', line 32

def token
  @token
end

#user_identifier_keyString?

Your user ID for the user associated with the client session.

Returns:

  • (String, nil)


35
36
37
# File 'lib/seam/resources/client_session.rb', line 35

def user_identifier_key
  @user_identifier_key
end

#user_identity_idString?

ID of the user identity associated with the client session.

Returns:

  • (String, nil)


38
39
40
# File 'lib/seam/resources/client_session.rb', line 38

def user_identity_id
  @user_identity_id
end

#user_identity_idsArray<String>

Deprecated.

Use user_identity_id instead.

IDs of the user identities associated with the client session.

Returns:

  • (Array<String>)


42
43
44
# File 'lib/seam/resources/client_session.rb', line 42

def user_identity_ids
  @user_identity_ids
end

#workspace_idString

ID of the workspace associated with the client session.

Returns:

  • (String)


45
46
47
# File 'lib/seam/resources/client_session.rb', line 45

def workspace_id
  @workspace_id
end

Instance Method Details

#created_atTime

Date and time at which the client session was created.

Returns:

  • (Time)


49
# File 'lib/seam/resources/client_session.rb', line 49

date_accessor :created_at

#expires_atTime

Date and time at which the client session expires.

Returns:

  • (Time)


53
# File 'lib/seam/resources/client_session.rb', line 53

date_accessor :expires_at