A connection represents the relationship between WorkOS and any collection of application users. This collection of application users may include personal or enterprise identity providers. As a layer of abstraction, a WorkOS connection rests between an application and its users, separating an application from the implementation details required by specific standards like OAuth 2.0 and SAML.
See the events reference documentation for the connection events.
const connection = { id: 'conn_01E4ZCR3C56J083X43JQXF3JK5', organizationId: 'org_01EHWNCE74X7JSDV0X3SZ3KJNY', type: 'OktaSAML', name: 'Foo Corp', state: 'active', createdAt: '2021-06-25T19:07:33.155Z', updatedAt: '2021-06-25T19:07:33.155Z', domains: [ { id: 'org_domain_01EHZNVPK2QXHMVWCEDQEKY69A', object: 'connection_domain', domain: 'foo-corp.com', }, ], };
interface ConnectionGet the details of an existing connection.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const connection = await workos.sso.getConnection( 'conn_01E4ZCR3C56J083X43JQXF3JK5', );
Get a list of all of your existing connections matching the criteria specified.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const connectionList = await workos.sso.listConnections(); console.log(connectionList.data);
sso .listConnections()Parameters objectReturns objectPermanently deletes an existing connection. It cannot be undone.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); await workos.sso.deleteConnection('conn_01E2NPPCT7XQ2MVVYDHWGK1WN4');
sso .deleteConnection()Parameters