Exploring the ServiceNow SDK
Summarize
Summary of Exploring the ServiceNow SDK
The ServiceNow SDK allows developers to create and manage scoped applications locally using Visual Studio Code, starting from the Washington DC release. This enables offline development and access to features not available in the ServiceNow IDE.
Show less
Key Features
- Local Development: Develop applications offline in Visual Studio Code, utilizing ServiceNow Fluent for application metadata and JavaScript modules.
- Command-Line Interface (CLI): Manage instance and local application changes through simple CLI commands, including authentication, application creation, and installation.
- Application Packaging: The SDK also serves as a packaging service for applications within the ServiceNow IDE.
- Source Control Management: Applications can be managed in source control using Git, facilitating collaboration among developers.
Key Outcomes
By using the ServiceNow SDK, developers can efficiently build and install scoped applications, keep application metadata synchronized with their instance, and leverage existing code through modular design. This approach streamlines application development and enhances collaboration, ultimately improving productivity and application quality.
Learn about developing scoped applications in source code locally and installing changes on an instance with the ServiceNow SDK.
ServiceNow SDK overview
With the ServiceNow SDK, you can create and modify scoped applications locally in Visual Studio Code Desktop and install those applications on a non-production instance beginning with the Washington DC release. By developing applications locally, you can work offline and use features that are available in Visual Studio Code but not in the ServiceNow IDE.
In Visual Studio Code, you can develop scoped applications in source code using ServiceNow Fluent to define application metadata [sys_metadata], write custom JavaScript modules, or add third-party libraries.
The ServiceNow SDK includes a command-line interface (CLI) for managing changes between an instance and a local application. Using simple CLI commands, you can authenticate to an instance, create or convert an application, transform application metadata (XML) into ServiceNow Fluent code, build and install the application on the instance, and more.
The ServiceNow SDK also serves as the application packaging service that builds applications in the ServiceNow IDE. For more information, see Exploring the ServiceNow IDE.
ServiceNow SDK workflow
The following infographic shows the workflow for developers to get started developing applications with the ServiceNow SDK.
- A developer installs the ServiceNow SDK locally. For more information, see Install the ServiceNow SDK in an application.
- Using the CLI, the developer authenticates to a non-production instance to interface between their local environment and the instance with the
now-sdk authcommand. The developer must have the admin role on the instance. - The developer creates a scoped application (
now-sdk init) or converts an existing scoped application from the instance (now-sdk init --from) for use with the ServiceNow SDK. - In Visual Studio Code, the developer can define application metadata in source code using ServiceNow Fluent, create custom JavaScript modules, or use third-party libraries.
They can also download application and script dependencies from the instance to code against (
now-sdk dependencies). - The developer builds the application, which compiles the source code and transforms it into application metadata for the instance (
now-sdk build). - The developer installs the application on the instance (
now-sdk install). - Other users can continue to modify the application metadata on the instance, and developers can reuse the code from modules in other modules or scripts within the application.
- The developer downloads and transforms application metadata from the instance to get the latest updates to the application metadata locally (
now-sdk transform), keeping it synchronized with the application on the instance.
You can manage applications in source control with your preferred Git provider. To develop a scoped application on another system with the ServiceNow SDK, other developers should clone the application from a remote GIt repository rather than downloading and transforming it from the instance.
ServiceNow SDK benefits
| Benefit | Feature | Users |
|---|---|---|
| Develop applications offline, outside of an instance in Visual Studio Code and manage them in source control with your preferred Git provider. | Developing applications with the ServiceNow SDK | Developers |
| Write source code to define the metadata that makes up ServiceNow applications | ServiceNow Fluent | Developers |
| Organize and reuse code within scoped applications with custom JavaScript modules and third-party JavaScript utilities | JavaScript modules and third-party libraries | Developers |