---
url: /api/formats/interactions/src/functions/withPrefix.md
---
[pantoken-root](../../../../index.md) / [formats/interactions/src](../index.md) / withPrefix

# Function: withPrefix()

> **withPrefix**(`text`, `prefix?`): `string`

Swap every `pfx-` sentinel in `text` for the namespace of `prefix` (default `"instui"`).

## Parameters

### text

`string`

### prefix?

`string` = `DEFAULT_PREFIX`

## Returns

`string`
