connect()
connect(location, connector, options)
Name
Type
Description
Error type
Description
Example
import connect from '@aragon/connect'
// Connections should get wrapped in a try / catch to capture connection errors
try {
// Connect to an org through The Graph
const org1 = await connect('org1.aragonid.eth', 'thegraph')
// Specify a different Chain ID
const org3 = await connect('org3.aragonid.eth', 'thegraph', { network: 4 })
// Specify a configuration for the connector
const org3 = await connect('org3.aragonid.eth', [
'thegraph',
{ orgSubgraphUrl: 'http://โฆ' },
])
// Custom connector
const org4 = await connect(
'org4.aragonid.eth',
// CustomConnector implements IConnector
new CustomConnector()
)
} catch (err) {
if (err instanceof ConnectionError) {
console.error('Connection error')
} else {
console.error(err)
}
}Last updated
Was this helpful?
