Skip to content

Function: navigate()

ts
function navigate(ctx: Context, options: NavigateOptions): Promise<void | Context>;

Defined in: src/pages/index.ts:355

Experimental

Navigate to a URL with configurable page creation options.

Parameters

ParameterTypeDescription
ctxContextThe current Context.
optionsNavigateOptionsNavigation options including URL, tab creation, and background flags.

Returns

Promise<void | Context>

A Context for the target page, or void when navigating in place.

Example

ts
// Open a vendor catalog in a new background tab.
const catalogCtx = await navigate(ctx, {
  url: 'https://vendors.megacorp.com/catalog',
  createPage: true,
  background: true,
});

Matterway Assistant SDK Documentation