Skip to main content

getTransport

Get the SDK transport object, either from the provided override or from the...

Import

You can import the entire package and access the function:


_10
import * as sdk from "@onflow/sdk"
_10
_10
sdk.getTransport(override)

Or import directly the specific function:


_10
import { getTransport } from "@onflow/sdk"
_10
_10
getTransport(override)

Usage


_13
import * as fcl from "@onflow/fcl";
_13
import { httpTransport } from "@onflow/transport-http";
_13
_13
// Get default transport (usually HTTP transport)
_13
const defaultTransport = await fcl.getTransport();
_13
_13
// Override with custom transport
_13
const customTransport = await fcl.getTransport({
_13
transport: httpTransport({
_13
accessNode: "https://rest-mainnet.onflow.org",
_13
timeout: 10000
_13
})
_13
});

Parameters

override (optional)

  • Type: SdkTransport;
  • Description: Override default configuration with custom transport or send function

Returns

Promise<SdkTransport>


Rate this page