aztea-connect
v0.2.0
Published
Browser Connect launcher for AgentWeb: popup with same-tab redirect fallback
Readme
aztea-connect
The browser half of an embedded AgentWeb connection. It never receives an AgentWeb API key. Your backend creates a connect session for its own end-user identifier, then this package opens the returned single-use URL in a mobile-safe popup with a same-tab fallback.
import { openConnect } from 'aztea-connect'
await openConnect({
createConnectSession: async () => {
const response = await fetch('/api/integrations/amazon/connect', {
method: 'POST',
})
if (!response.ok) throw new Error('Could not start connection')
return response.json()
},
onSuccess(connection) {
console.log(connection.integrationId, connection.status)
},
})The backend route uses the server-side AgentWeb SDK. Device capabilities do not
return connect URLs and must be filtered using GET /v1/integrations?host_context=web.
