Connect a Device
5 mins
Before you can control a device, the owner of that device must first authorize your application. The owner may be you, or one of your application's users.
To do so, Seam provides Connect Views. It's a fully managed UI-flows, guiding your user through device selection and authorization.

To link a device with your workspace, the first step is to create a Connect View resource. The Seam API response will include a URL to redirect your user to.
Javascript
Python
Ruby
PHP
// Replace with
// const Seam = require("seamapi")
// if not using ES6 modules and/or TypeScript.
import Seam from "seamapi";
// Seam will automatically use the SEAM_API_KEY environment variable if you
// don't provide an apiKey to `new Seam()`
const seam = new Seam();
const createConnectView = async () => {
const { connect_webview: connectView } = await seam.connectWebviews.create({
accepted_providers: ["august"],
});
console.log(connectView);
};
createConnectView();
/*
{
connect_webview_id: '14db0efd-50ae-45ef-9042-7f95c09082c2',
custom_redirect_url: null,
url: 'https://connect.getseam.com/v1/connect_webviews/view?connect_webview_id=14db0efd-50ae-45ef-9042-7f95c09082c2&auth_token=N4ZJau88guo5adHyBAPLsYdiCdoQvxpDb',
workspace_id: 'ab804f5a-7dd2-42c8-8d09-0beff4f795eb',
device_selection_mode: 'none',
accepted_providers: [ 'august' ],
accepted_devices: [],
any_provider_allowed: false,
any_device_allowed: null,
created_at: '2022-02-16T17:45:10.523Z',
login_successful: false,
status: 'pending'
}
*/
from seamapi import Seam
# Seam will automatically use the SEAM_API_KEY environment variable if you
# don't provide an api_key to `Seam()`
seam = Seam()
webview = seam.connect_webviews.create(accepted_providers=["august"])
print(webview)
# ConnectWebview(
# connect_webview_id='54429654-8b80-4481-93ac-b631cbdf9647',
# status='pending',
# url='https://connect.getseam.com/v1/connect_webviews/view?connect_webview_id=54429654-8b80-4481-93ac-b631cbdf9647&auth_token=KmHkSPAxLEtwEZkLoepbj9HuySbC6EFyQ',
# login_successful=False,
# connected_account_id=None)
require "seamapi"
seam = Seam::Client.new(api_key: "MY_API_KEY")
webview = seam.connect_webviews.create(
accepted_providers: ["august"]
)
puts 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=["august"]
# any_device_allowed=nil
# connect_webview_id="123e4567-e89b-12d3-a456-426614174000"
# custom_redirect_url=nil
# any_provider_allowed=false
# device_selection_mode="none">
use Seam\SeamClient;
$seam = new SeamClient("YOUR_API_KEY");
$webview = $seam->connect_webviews->create(
accepted_providers: ["august"]
);
echo json_encode($webview)
/*
{
connect_webview_id: "14db0efd-50ae-45ef-9042-7f95c09082c2",
custom_redirect_url: null,
url: "https://connect.getseam.com/v1/connect_webviews/view?connect_webview_id=14db0efd-50ae-45ef-9042-7f95c09082c2&auth_token=N4ZJau88guo5adHyBAPLsYdiCdoQvxpDb",
workspace_id: "ab804f5a-7dd2-42c8-8d09-0beff4f795eb",
device_selection_mode: "none",
accepted_providers: ["august"],
accepted_devices: [],
any_provider_allowed: false,
any_device_allowed: null,
created_at: "2022-02-16T17:45:10.523Z",
login_successful: false,
status: "pending"
}
*/
In a browser, enter the URL returned by the Connect View.

Seam's Sandbox workspace comes with simulated devices that behave like real ones. Simulated devices are handy for testing integrations without needing to own the actual device!
In the real world, devices belong to an owner. This owner can be you, or one of your users. To connect to their device, they must first authorize your application using their device credentials.
In the Seam Sandbox, we pre-seed fake device owners for you to use. Each simulated device belongs to a fake owner. To link a simulated device, you need its fake owner's account credentials. You can find those credentials in the Sandbox guide.
Here we will use Jane's sample data.
Per our Sandbox guide, Jane has three August locks ("Front Door," "Back Door," and "Garage").
Her credentials are as followed:
- email:
[email protected]
- password:
1234
- 2FA code:
123456
Enter those in the Connect View when prompted.