Seam Docs
Search…
Connect Webviews
Use Connect Webview to connect to your users' smart devices with the Seam API

Introduction to Connect Webview

​
Connect Webview is a component that your users will interact with in order to link their smart devices to Seam and allow you to access their devices via the Seam API.
Seam Connect Webview will handle credential validation, multi-factor authentication, and error handling for each device type that we support.
To allow a user to sign in, you need to create a connect_webview . After creating the webview, you'll receive a URL that you can use to open an iframe or new window containing a login page for your user.

The Connect Webview Object

connect_webview_id
uuid
ID of the Connect Webview
accepted_providers
string[]
List of accepted device providers keys​
status
string
pending or authorized
url
string
URL to the webview
login_successful
boolean
Whether the user logged in successfully using the webview
connected_account_id
uuid
ID of the Connected Account that was created after the user successfully logged in

Device Provider Keys

Brand Name
Device Provider Key
Device Features supported
​August Home​
august
​Access Codes, Locks​
​Noiseaware​
noiseaware
​Noise Detection​
​Schlage Connect​
schlage
​Access Codes, Locks​
​SmartThings​
smartthings
​Access Codes, Locks​
​

Create a Connect Webview

To allow a user to sign in, you need to create a connect_webview . After creating the webview, you'll receive a URL that you can use to open an iframe or new window containing a login page for your user.
An example of what the webview will look like to your user:
post
https://connect.getseam.com
/connect_webviews/create
Create a connect_webview
Ruby
require "seamapi"
​
seam = Seam::Client.new(api_key: "MY_API_KEY")
​
connect_webview = seam.connect_webviews.create(
accepted_providers: ["smartthings"]
)
​
puts connect_webview
# <Seam::ConnectWebview:0x006a950
# url="https://connect.getseam.com/connect_webviews/view?connect_webview_id=123e4567-e89b-12d3-a456-426614174000&auth_token=q123DASDASKd23DADdad29"
# status="pending"
# created_at="2022-07-06T23:20:09.785729+00:00"
# workspace_id="123e4567-e89b-12d3-a456-426614174000"
# accepted_devices=[]
# login_successful=false
# accepted_providers=["smartthings"]
# any_device_allowed=nil
# connect_webview_id="123e4567-e89b-12d3-a456-426614174000"
# custom_redirect_url=nil
# any_provider_allowed=false
# device_selection_mode="none">
You should make a new connect_webview for each unique login request: Each connect_webview tracks the user that signed in with it, you'll get an error if you re-use a webview for the same user twice, or if you use the same webview for multiple users.

Checking a Connect Webview

Unless you're using the custom_redirect_url you'll probably want to poll your newly created connect_webview to know if the user has signed in, or to get details about what devices they connected.
get
https://connect.getseam.com
/connect_webviews/get
Get details of a webview
Python
Javascript
Ruby
seam.connect_webviews.get("123e4567-e89b-12d3-a456-426614174000")
​
# ConnectWebview(
# connect_webview_id='123e4567-e89b-12d3-a456-426614174000',
# status='pending',
# url='https://connect.getseam.com/v1/connect_webviews/view?connect_webview_id=123e4567-e89b-12d3-a456-426614174000&auth_token=0000000000000000000000000000',
# login_successful=False,
# connected_account_id=None
# )
// Coming Soon!
require "seamapi"
​
seam = Seam::Client.new(api_key: "MY_API_KEY")
connect_webview_id = "123e4567-e89b-12d3-a456-426614174000"
​
connect_webview = seam.connect_webviews.get(connect_webview_id)
​
puts connect_webview
# <Seam::ConnectWebview:0x00bd4e8
# url="https://connect.getseam.com/connect_webviews/view?connect_webview_id=48880840-278b-4f55-bdc4-42ba8611952b&auth_token=asjDHKADH8392hf923FH"
# status="pending"
# created_at="2022-07-06T14:18:41.556Z"
# workspace_id="182ad8b2-4212-4640-873b-343c10b11c91"
# accepted_devices=[]
# login_successful=false
# accepted_providers=["august"]
# any_device_allowed=nil
# connect_webview_id="48880840-278b-4f55-bdc4-42ba8611952b"
# any_provider_allowed=false
# device_selection_mode="none">
​

List Connect Webviews

get
https://connect.getseam.com
/connect_webviews/list
Fetch list of Connect Webviews
Ruby
require "seamapi"
​
seam = Seam::Client.new(api_key: "MY_API_KEY")
​
connect_webviews = seam.connect_webviews.list
​
puts connect_webviews
# [<Seam::ConnectWebview:0x00bd4e8
# url="https://connect.getseam.com/connect_webviews/view?connect_webview_id=48880840-278b-4f55-bdc4-42ba8611952b&auth_token=asjDHKADH8392hf923FH"
# status="pending"
# created_at="2022-07-06T14:18:41.556Z"
# workspace_id="182ad8b2-4212-4640-873b-343c10b11c91"
# accepted_devices=[]
# login_successful=false
# accepted_providers=["august"]
# any_device_allowed=nil
# connect_webview_id="48880840-278b-4f55-bdc4-42ba8611952b"
# any_provider_allowed=false
# device_selection_mode="none">]
​

View Connect Webview

get
https://connect.getseam.com
/connect_webviews/view
Render the Connect Webview
​