Interface: SnapOptions
Flat snap options. Used via the snap key in your build config.
Deprecated
Prefer the snapcraft key with an explicit base field (e.g.
{ "snapcraft": { "base": "core24", "core24": { ... } } }). The flat snap
interface is maintained for backward compatibility and targets core22 and
older snap bases only.
Fields inherited from CommonLinuxOptions (e.g. description, category,
mimeTypes, executableArgs) are automatically populated from linux.* configuration
and do not need to be repeated here. Per-core values take precedence when both are set.
Extends
Properties
after?
readonlyoptionalafter?:string[] |null
Names of snapcraft parts that must be built before the app part.
Defaults to ["desktop-gtk2"].
Use "default" to keep the default and add extras:
["default", "my-helper-part"].
allowNativeWayland?
readonlyoptionalallowNativeWayland?:boolean|null
Allow the snap to run with native Wayland support (--ozone-platform=wayland).
Defaults to false for Electron < 38 (legacy behaviour); true for Electron ≥ 38.
Set explicitly to override the version-based default.
appPartStage?
readonlyoptionalappPartStage?:string[] |null
Filesets controlling which files from the app part are staged into the snap.
Supports individual files, directories, globs, globstars, and exclusions (prefix !).
See Snapcraft filesets.
When not set, the snap template's default stage list is used for legacy bases (core18/core20/core22).
artifactName?
readonlyoptionalartifactName?:string|null
The artifact file name template.
Inherited from
TargetSpecificOptions.artifactName
assumes?
readonlyoptionalassumes?:string|string[] |null
Snapd features that must be present on the host before the snap can be installed.
autoStart?
readonlyoptionalautoStart?:boolean
Whether the snap should automatically start on login.
Default
false
base?
readonlyoptionalbase?:string|null
The snap base to use as the execution environment.
Examples: core18, core20, core22.
For new projects, use the snapcraft key with base: "core24" instead of
this legacy interface.
buildPackages?
readonlyoptionalbuildPackages?:string[] |null
Debian packages required at build time (installed inside the build environment).
category?
readonlyoptionalcategory?:string|null
The application category.
Inherited from
compression?
readonlyoptionalcompression?:"xz"|"lzo"|null
Compression algorithm for the snap SquashFS image.
xz— smaller file, slower decompression (good for distribution).lzo— larger file, faster decompression (good for development iteration). Omit to use snapcraft's default (xz).
When not set, linux.compression is mapped automatically:
"store" → "lzo", "maximum" → "xz", "normal" → snapcraft default.
Explicitly setting this field always overrides the mapped value.
confinement?
readonlyoptionalconfinement?:"devmode"|"strict"|"classic"|null
The type of snap confinement.
strict— recommended; the snap runs in a fully isolated sandbox.devmode— sandbox violations are logged but not enforced; for development only.classic— no confinement; equivalent to a traditionally packaged application. Requires Snap Store approval before publishing.
Default
strict
description?
readonlyoptionaldescription?:string|null
As description from application package.json, but allows you to specify different for Linux.
Inherited from
CommonLinuxOptions.description
desktop?
readonlyoptionaldesktop?:LinuxDesktopFile|null
The Desktop file
Inherited from
environment?
readonlyoptionalenvironment?: {[key:string]:string; } |null
Environment variables injected into the snap's runtime environment.
Merged with the electron-builder default { TMPDIR: "$XDG_RUNTIME_DIR" }.
User-supplied values take precedence.
executableArgs?
readonlyoptionalexecutableArgs?:string[] |null
The executable parameters. Pass to executableName
Inherited from
CommonLinuxOptions.executableArgs
grade?
readonlyoptionalgrade?:"devel"|"stable"|null
The quality grade of the snap.
stable— suitable for all channels, includingstableandcandidate.devel— development snapshot; cannot be promoted tostableorcandidate.
Default
stable
hooks?
readonlyoptionalhooks?:string|null
Directory containing snap hooks, relative to
the build resources directory (build/).
Default
build/snap-hooks
layout?
readonlyoptionallayout?: {[key:string]:object; } |null
Snap layouts — bind-mount or symlink host paths
into the snap's namespace, making libraries or config at /usr, /var, /etc, etc.
accessible inside the confined environment.
mimeTypes?
readonlyoptionalmimeTypes?: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
plugs?
readonlyoptionalplugs?:PlugDescriptor| (string|PlugDescriptor)[] |null
Plugs (consumed interfaces) to declare
for the app entry point.
Defaults to ["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"].
Use "default" in the list to keep the defaults and append extras:
["default", "camera"] adds camera to the standard set.
To configure plug attributes (e.g. allow-sandbox for Chromium's internal sandbox),
use a descriptor object:
[
{ "browser-sandbox": { "interface": "browser-support", "allow-sandbox": true } },
"another-simple-plug-name"
]
publish?
optionalpublish?:Publish
Inherited from
slots?
readonlyoptionalslots?:SlotDescriptor| (string|SlotDescriptor)[] |null
Slots (provided interfaces) to declare for the app.
To expose an MPRIS player under the Chromium bus name (required for strict confinement):
[{ "mpris": { "name": "chromium" } }]
Chromium hard-codes
the bus name chromium, so the slot name must match for snapd to
allow it.
stagePackages?
readonlyoptionalstagePackages?:string[] |null
Ubuntu packages to stage alongside the app (equivalent to depends for deb).
Defaults to ["libnspr4", "libnss3", "libxss1", "libappindicator3-1", "libsecret-1-0"].
Use the "default" keyword to extend the default list:
["default", "my-extra-lib"] appends my-extra-lib to the defaults.
summary?
readonlyoptionalsummary?:string|null
A short summary of the snap (max 78 characters). Defaults to productName.
synopsis?
readonlyoptionalsynopsis?:string|null
The short description.
Inherited from
title?
readonlyoptionaltitle?:string|null
Display title for the snap (may contain uppercase letters and spaces).
Defaults to productName.
See snap format.
useTemplateApp?
readonlyoptionaluseTemplateApp?:boolean
Whether to use the pre-built Electron snap template for faster builds.
When true, electron-builder delegates snap assembly to the upstream Electron snap
template rather than running a full snapcraft build, significantly reducing build time.
Defaults to true when stagePackages is not customised.
Only applicable to x64 and armv7l builds.