The bitbucket:repoCodeFileViewer module adds a dropdown item to the dropdown of the Bitbucket file content header. When you select the menu item, the file content will be rendered using the custom file viewer. You can use UI Kit or Custom UI to create the custom file viewer.

| Property | Type | Required | Description |
|---|---|---|---|
key |
| Yes |
A key for the module, which other modules can refer to. Must be unique within the manifest. Regex: |
resource | string | If using Custom UI or modern versions of UI Kit | The key of a static resources entry that your module will display. See resources for more details. |
render | 'native' | If using modern versions of UI Kit | Indicates the module uses UI Kit. |
resolver | { function: string } or{ endpoint: string } |
Set the Set the | |
title | string or i18n object | Yes |
The title of the file viewer, which is displayed as a dropdown item. The |
filePattern | string | No |
The regex pattern specifying which files the file viewer should be available for. The pattern matching is case-insensitive. For example, to make it available for all markdown files, use If unspecified, it will be available for all files. |
| Key | Type | Required | Description |
|---|---|---|---|
i18n | string | Yes | A key referencing a translated string in the translation files. For more details, see Translations. |
Use the useProductContext hook to access the extension context in UI Kit or getContext bridge method in Custom UI.
| Property | Type | Description |
|---|---|---|
type | string | The type of the module. |
repository | object | The repository where the file is located. |
repository.uuid | string | The repository UUID which will be wrapped in {}. |
file.path | string | The file path relative to the repository root. |
commit.hash | string | The commit hash (SHA) of the branch. |
location | string | The full URL of this page. |
Some Forge APIs (for example, storage API) do not support {}. You can use the unwrapUUid and
wrapUuid functions to convert a Bitbucket resource ID between a wrapped and unwrapped UUID. See
unwrapUuid/wrapUuid helper functions
for more information.
Rate this page: