Fetch Active Theme and Extension Files

If creating an extension for SuiteCommerce or SCA, you must first download files for the currently active theme before you can deploy an extension or test it on a local server. You do this by running the following command:

gulp extension:fetch

Note:

SCIS extension developers can disregard this section.

This command:

The developer tools require theme files (HTML and Sass) to compile a local distribution for testing an extension on a local server. The developer tools also use these files to run a test compilation before deploying. When you fetch the active theme, you provide the necessary files in your local extension workspace. Later, when you test locally or deploy your extension, the developer tools can compile the code without error.

If you want to skip this step, you can run the gulp extension:deploy --skip-compilation command to deploy your extension files without running the compilation. For more Gulp.js commands used with extensions, see Extension Developer Gulp Commands.

The gulp extension:fetch command also fetches files for any custom extensions. When you fetch files for an active extension, you download these development files to your local extension workspace. You can now customize these files further development and testing.

Warning:

When you fetch custom extension files, the developer tools download extension files that are activated for the specified domain. This action overwrites any extension files currently stored in your local workspace. This can result in loss of development files if you are not careful. To ensure that you do not lose any work under development, do not run the gulp extension:fetch command until you have deployed your extension work to NetSuite.

Note:

This command does not download files for published extensions. A published extension is an extension installed into your account as part of a published SuiteApp. You cannot edit published content due to copyright restrictions.

Fetch the active files:

  1. In your local developer environment, open a command line or terminal and access the top-level extension development directory.

  2. Run the following command:

    gulp extension:fetch

    Note:

    For release 2021.2.1 and later accounts that have account-specific domains, specify your account number with the gulp command to enable access to the NetSuite account. For more information about using gulp extension:fetch --account, see Extension Developer Gulp Commands.

  3. When prompted, enter the following information:

    Authentication ID

    Enter an ID to represent your NetSuite account and role.

    If you have already created an authentication ID in a previous fetch or deploy operation, the extension developer tools do not prompt you for an ID and will continue to use the existing ID for each subsequent fetch or deploy.

    To fetch from a NetSuite account that is different from the account used to create the existing authentication ID, use the --to parameter. When you use the use the --to parameter, you can choose a different authentication ID or create a new one. For more information, see Token Based Authentication.

    Account and Role

    If you are creating a new authentication ID, you need to select the NetSuite account and role to use with that new authentication ID. If using an existing ID, you are not prompted for this information.

    In NetSuite, select the account that contains the theme or extensions you want to fetch and the role you want to use for authentication. Click the Allow button to generate the authentication token and secret.

    Note:

    You must select a role that provides the permissions needed to fetch from NetSuite. By default, the Administrator and SCDeployer roles provide these permissions. To learn more, including how to create a custom role that provides the required permissions, see Developer Tool Roles and Permissions.

    Choose Your Website

    Select your website with the domain you want to access.

    Choose Your Domain

    Select your domain with the active theme or extensions you want to download.

    Extensions to Fetch

    If you have any active extensions for the domain selected, you can download the working files of any selected extensions. This is optional. Content downloads to your extension’s Extras folder.

The gulp extension:fetch command creates a theme subdirectory in your Workspace/Extras directory. These files are for use by the developer tools only. Do not add, edit, delete, or move any files in this location.

You are now ready to perform either of the following tasks:

Related Topics

Get Started with Extensions
Create a Baseline Extension

General Notices