Skip to content
Release: Australia · Updated: 2026-06-02 · Official documentation · View source

Building applications in source code

Create and develop custom applications in source code using familiar development tools and processes.

Overview of development in source code

You can create applications in code using the ServiceNow IDE on the ServiceNow AI Platform or locally in Visual Studio Code Desktop with the ServiceNow SDK.

In either development environment, you use ServiceNow Fluent, a domain-specific programming language, to define the metadata that makes up applications. ServiceNow Fluent includes APIs for defining the different types of metadata.

With the ServiceNow IDE or ServiceNow SDK, you can also create JavaScript modules and use third-party libraries in your application to optimize code reuse in scripts within an application scope.

Developing and maintaining applications in source code enables you to work in familiar development environments, create and modify complex applications, manage code in source control more easily, and catch errors at build time.

Comparison of the ServiceNow IDE and the ServiceNow SDK

FeatureServiceNow IDEServiceNow SDK
Development environmentOnline ServiceNow instanceLocal development and the ability to work offline
User interfaceIDE based on Visual Studio Code for the WebVisual Studio Code Desktop
CollaborationView any user's changes in real time in code or embedded ServiceNow AI Platform user interfaces.Collaborate with other developers on applications in source control.Download changes from an instance and install local changes to an instance using the ServiceNow SDK CLI to collaborate with other users. Collaborate with other developers on applications in source control.
Source controlSupports the most common Git functionality and integrating with a Git provider of your choice.One concurrent branch per repository per instance\(or developer sandbox\).Full support
Application conversionSupport for converting existing applications not created with the ServiceNow IDE or ServiceNow SDK.Support for converting existing applications not created with the ServiceNow IDE or ServiceNow SDK.
ServiceNow FluentFull supportThe ServiceNow Fluent Language server is included with the ServiceNow IDE.Full supportThe ServiceNow Fluent Language server can be installed from the Visual Studio Code Extension Marketplace.
JavaScript modules and third-party librariesFull supportFull support
Now Assist for CodeCode auto-complete support for scripts.For information about activation, see Now Assist for Code.Not supported
Build AgentFull support. Build Agent is accessed from a chat panel in the ServiceNow IDE.For information about activation, see Build Agent.Build Agent skills are available beginning with ServiceNow SDK version 4.6.0.

Application structure

Applications created or converted with the ServiceNow IDE or ServiceNow SDK include source code files and metadata XML files. The package.json and now.config.json files define the application structure, which is similar to that of Node.js applications or Node Package Manager (npm) packages.

Image omitted: servicenow-ide-app-structure.png
Structure of an application created in the ServiceNow IDE

By default, applications include the following directories and files. You can modify certain aspects of the application structure to suit your needs in the now.config.json file.

Directory or fileDescription
.vscodeDirectory containing recommended Visual Studio Code extensions.
distDirectory containing the build artifacts for packaging. This directory includes the following subdirectories:- `app`: Directory containing the built metadata XML files. - `static`: Directory containing the built static asset files.
metadata

Directory containing the application metadata (XML) of the application, such as table schemas and business rules, organized in the same directory structure as existing ServiceNow applications.

Note: Application metadata shouldn't be edited from the XML files. Edit application metadata in the source code or on the ServiceNow AI Platform.

node\_modulesDirectory containing the third-party Node.js modules on which your application depends.
srcDirectory containing the source code of your application. This directory includes the following subdirectories:- `client`: Directory containing the client-side files for developing user interfaces. - `fluent`: Directory containing ServiceNow Fluent code in `.now.ts` files. The `generated` subdirectory contains the application files converted to ServiceNow Fluent. - `server`: Directory containing JavaScript module code in `.js` or `.ts` files.
targetDirectory containing an installable package \(`.zip` file\) to upload to an instance.
.eslintrcFile containing the ESLint configuration. ESLint helps identify and fix issues in the application code.
.gitignoreFile containing a list of directories or files for Git to ignore. These files aren't tracked in source control.
now.config.jsonFile containing the ServiceNow application configuration. The `now.config.json` file must be in the base directory for an application. You can configure aspects of an application by adding support parameters. For more information, see Custom application configuration in source code.
now.prebuild.mjsAuto-updated file containing complete information about dependencies and their versions. This file is only available with the ServiceNow SDK.
package-lock.jsonAuto-updated file containing complete information about dependencies and their versions. This file is only available with the ServiceNow SDK.
package.jsonFile containing information about your application and custom or third-party module dependencies. The package.json file must be in the base directory for an application. On an instance, the package.json path is specified in the Package JSON field of the custom application record [sys_app] in the format <scope>/<package-name>/<version>/package.json.
  • JavaScript APIs

    Use JavaScript APIs in scripts that you write to change the functionality of applications or when you create applications.

Related topics

ServiceNow Fluent

JavaScript modules and third-party libraries

User interface development with React

Custom application configuration in source code