Skip to main content

Interface: SnapOptions

Extends

Properties

after?

readonly optional after?: string[] | null

Specifies any parts that should be built before this part. Defaults to ["desktop-gtk2""].

If list contains default, it will be replaced to default list, so, ["default", "foo"] can be used to add custom parts foo in addition to defaults.


allowNativeWayland?

readonly optional allowNativeWayland?: boolean | null

Allow running the program with native wayland support with --ozone-platform=wayland. Disabled by default because of this issue in older Electron/Snap versions: https://github.com/electron-userland/electron-builder/issues/4007


appPartStage?

readonly optional appPartStage?: string[] | null

Specifies which files from the app part to stage and which to exclude. Individual files, directories, wildcards, globstars, and exclusions are accepted. See Snapcraft filesets to learn more about the format.

The defaults can be found in snap.ts.


artifactName?

readonly optional artifactName?: string | null

The artifact file name template.

Inherited from

TargetSpecificOptions.artifactName


assumes?

readonly optional assumes?: string | string[] | null

The list of features that must be supported by the core in order for this snap to install.


autoStart?

readonly optional autoStart?: boolean

Whether or not the snap should automatically start on login.

Default

false

base?

readonly optional base?: string | null

A snap of type base to be used as the execution environment for this snap. Examples: core, core18, core20, core22. Defaults to core20


buildPackages?

readonly optional buildPackages?: string[] | null

The list of debian packages needs to be installed for building this snap.


category?

readonly optional category?: string | null

The application category.

Inherited from

CommonLinuxOptions.category


compression?

readonly optional compression?: "xz" | "lzo" | null

Sets the compression type for the snap. Can be xz, lzo, or null.


confinement?

readonly optional confinement?: "devmode" | "strict" | "classic" | null

The type of confinement supported by the snap.

Default

strict

description?

readonly optional description?: string | null

As description from application package.json, but allows you to specify different for Linux.

Inherited from

CommonLinuxOptions.description


desktop?

readonly optional desktop?: LinuxDesktopFile | null

The Desktop file

Inherited from

CommonLinuxOptions.desktop


environment?

readonly optional environment?: {[key: string]: string; } | null

The custom environment. Defaults to {"TMPDIR: "$XDG_RUNTIME_DIR"}. If you set custom, it will be merged with default.


executableArgs?

readonly optional executableArgs?: string[] | null

The executable parameters. Pass to executableName

Inherited from

CommonLinuxOptions.executableArgs


grade?

readonly optional grade?: "devel" | "stable" | null

The quality grade of the snap. It can be either devel (i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels).

Default

stable

hooks?

readonly optional hooks?: string | null

The hooks directory, relative to build (build resources directory).

Default

build/snap-hooks

layout?

readonly optional layout?: {[key: string]: object; } | null

Specifies any files to make accessible from locations such as /usr, /var, and /etc. See snap layouts to learn more.


mimeTypes?

readonly optional mimeTypes?: string[] | null

The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing.

Inherited from

CommonLinuxOptions.mimeTypes


plugs?

readonly optional plugs?: PlugDescriptor | (string | PlugDescriptor)[] | null

The list of plugs. Defaults to ["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"].

If list contains default, it will be replaced to default list, so, ["default", "foo"] can be used to add custom plug foo in addition to defaults.

Additional attributes can be specified using object instead of just name of plug:

[
{
"browser-sandbox": {
"interface": "browser-support",
"allow-sandbox": true
},
},
"another-simple-plug-name"
]

publish?

optional publish?: Publish

Inherited from

TargetSpecificOptions.publish


slots?

readonly optional slots?: PlugDescriptor | (string | SlotDescriptor)[] | null

The list of slots.

Additional attributes can be specified using object instead of just name of slot:

[
{
"mpris": {
"name": "chromium"
},
}
]

In case you want your application to be a compliant MPris player, you will need to definie
The mpris slot with "chromium" name.
This electron has it [hardcoded](https://source.chromium.org/chromium/chromium/src/+/master:components/system_media_controls/linux/system_media_controls_linux.cc;l=51;bpv=0;bpt=1),
and we need to pass this name so snap [will allow it](https://forum.snapcraft.io/t/unable-to-use-mpris-interface/15360/7) in strict confinement.

***

### stagePackages?

> `readonly` `optional` **stagePackages?**: `string`[] \| `null`

The list of Ubuntu packages to use that are needed to support the `app` part creation. Like `depends` for `deb`.
Defaults to `["libnspr4", "libnss3", "libxss1", "libappindicator3-1", "libsecret-1-0"]`.

If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom package `foo` in addition to defaults.

***

### summary?

> `readonly` `optional` **summary?**: `string` \| `null`

The 78 character long summary. Defaults to [productName](https://www.electron.build/configuration#productname).

***

### synopsis?

> `readonly` `optional` **synopsis?**: `string` \| `null`

The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).

#### Inherited from

[`CommonLinuxOptions`](/docs/api/app-builder-lib.Interface.CommonLinuxOptions).[`synopsis`](/docs/api/app-builder-lib.Interface.CommonLinuxOptions#synopsis)

***

### title?

> `readonly` `optional` **title?**: `string` \| `null`

An optional title for the snap, may contain uppercase letters and spaces. Defaults to `productName`. See [snap format documentation](https://snapcraft.io/docs/snap-format).

***

### useTemplateApp?

> `readonly` `optional` **useTemplateApp?**: `boolean`

Whether to use template snap. Defaults to `true` if `stagePackages` not specified.