Skip to content

safe

Connector for Safe Apps SDK.

Import

ts
import { safe } from 'wagmi/connectors'
import { safe } from 'wagmi/connectors'

Usage

ts
import { createConfig, http } from 'wagmi'
import { mainnet, sepolia } from 'wagmi/chains'
import { safe } from 'wagmi/connectors'

export const config = createConfig({
  chains: [mainnet, sepolia],
  connectors: [safe()],
  transports: {
    [mainnet.id]: http(),
    [sepolia.id]: http(),
  },
})
import { createConfig, http } from 'wagmi'
import { mainnet, sepolia } from 'wagmi/chains'
import { safe } from 'wagmi/connectors'

export const config = createConfig({
  chains: [mainnet, sepolia],
  connectors: [safe()],
  transports: {
    [mainnet.id]: http(),
    [sepolia.id]: http(),
  },
})

Parameters

ts
import { type SafeParameters } from 'wagmi/connectors'
import { type SafeParameters } from 'wagmi/connectors'

Check out the Safe docs for more info.

allowedDomains

RegExp[] | undefined

ts
import { safe } from 'wagmi/connectors'

const connector = safe({
  allowedDomains: [/app.safe.global$/], 
})
import { safe } from 'wagmi/connectors'

const connector = safe({
  allowedDomains: [/app.safe.global$/], 
})

debug

boolean | undefined

ts
import { safe } from 'wagmi/connectors'

const connector = safe({
  debug: true, 
})
import { safe } from 'wagmi/connectors'

const connector = safe({
  debug: true, 
})

shimDisconnect

boolean | undefined

  • This flag simulates disconnect behavior by keeping track of connection status in storage.
  • Defaults to false.
ts
import { safe } from 'wagmi/connectors'

const connector = safe({
  shimDisconnect: true, 
})
import { safe } from 'wagmi/connectors'

const connector = safe({
  shimDisconnect: true, 
})

Released under the MIT License.