---
sourceDocument: Yokohama Build or modify applications
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/application-development

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Script Include API

# Script Include API - ServiceNow Fluent {#ariaid-title1}

* Release version: Yokohama
* 
* Updated March 12, 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read

The Script Include API defines script includes \[sys_script_include\] that store JavaScript functions and classes for use by server-side scripts.
Note:  
For the latest ServiceNow Fluent API documentation and examples, see the [ServiceNow Fluent API reference](https://servicenow.github.io/sdk/) and [ServiceNow SDK examples repository](https://github.com/ServiceNow/sdk-examples) on GitHub.

For new scripts, use JavaScript modules instead of script includes when possible to support code reuse and using third-party libraries within
an
application scope. For more information about JavaScript module support and limitations, see [JavaScript modules and third-party libraries](https://servicenow-prod.fluidtopics.net/szZukjhL7dMD6ptK~0Z~aw "Optimize your code base using JavaScript modules to group related code or add third-party libraries and reuse their code within applications.").

For general information about script includes, see [Script includes](https://www.servicenow.com/docs/access?context=c_ScriptIncludes&version=yokohama&pubname=yokohama-api-reference&ft:locale=en-US).
**Related concepts**   

* [ServiceNow Fluent](https://servicenow-prod.fluidtopics.net/~uRaWXiuRJuyUsvJypBknQ "Define application metadata in source code using the ServiceNow Fluent domain-specific programming language.")

## ScriptInclude object {#ariaid-title2}

Create a script include \[sys_script_include\] to define a server-side script that runs when called from other scripts.
{#fluent-script-include-object__table_qyv_1pj_4fc__entry__3}{#fluent-script-include-object__now-id-desc2}

| Name | Type | Description |
|-|-|-|
| $id | String or Number | Required. A unique ID for the metadata object. When you build the application, this ID is hashed into a unique sys_id. For more information, see [ServiceNow Fluent language constructs](https://servicenow-prod.fluidtopics.net/3RTnzOESnTILKQIIO7V1sg "ServiceNow Fluent language constructs provide additional functionality for development in source code with ServiceNow Fluent APIs."). Format: `Now.ID['String' or Number]` |
| name | String | Required. The name of the script include. If you define a class, the name must match the name of the class, prototype, and type. If you use a classless (on demand) script include, the name must match the function name. |
| script | Script | Required. A server-side script to call from other scripts. The script must define a single JavaScript class or a global function. The class or function name must match the name property. This property supports inline JavaScript or a reference to another file in the application that contains a script. Format: * To use text content from another file, refer to a file in the application using the following format: `Now.include('path/to/file')`. For more information, see [ServiceNow Fluent language constructs](https://servicenow-prod.fluidtopics.net/3RTnzOESnTILKQIIO7V1sg "ServiceNow Fluent language constructs provide additional functionality for development in source code with ServiceNow Fluent APIs."). * To provide an inline script, use string literals or template literals for multiple lines of code: ``'Script' or `Script```. {#fluent-script-include-object__ul_zr2_zvg_5fc} |
| apiName | String | An internal name for the script include, which is used to call the script include from out-of-scope applications. Default: \<scope\>.\<name\> |
| description | String | A description of the purpose and function of the script include. |
| clientCallable | Boolean | Flag that indicates whether client-side scripts can call the script include using GlideAjax. The script include is available to client scripts, list/report filters, reference qualifiers, or if specified as part of the URL. Client callable script includes are invoked from GlideAjax and require users to satisfy an ACL associated with the script include. Valid values: * true: The script include is available to client-side scripts. * false: The script include isn't available to client-side scripts. {#fluent-script-include-object__ul_z4f_1dl_4fc} Default: false |
| mobileCallable | Boolean | Flag that indicates whether the script include is available to client scripts called from mobile devices. Valid values: * true: The script include is available to client scripts called from mobile devices. * false: The script include isn't available to client scripts called from mobile devices. {#fluent-script-include-object__ul_ajt_ydl_4fc} Default: false |
| sandboxCallable | Boolean | Flag that indicates whether the script include is available to scripts invoked from the script sandbox, such as a query condition. Important: Script includes should only be made available to the script sandbox if necessary. Valid values: * true: The script include is available to scripts invoked from the script sandbox. * false: The script include isn't available to scripts invoked from the script sandbox. {#fluent-script-include-object__ul_mz3_22l_4fc} Default: false |
| callerAccess | String | An option for how cross-scope access to the script include is permitted. For more information, see [Restricted caller access privilege settings](https://servicenow-prod.fluidtopics.net/tHQ~eSI2k_dzCwREkUG4Ug "Define cross-scope access to an application, application resource (such as an access control role, a business rule, a UI action, or a script include), or event. You can even use these settings to allow or deny requests for access."). Valid values: * restriction: Calls to the script include must be manually approved. Access requests are tracked in the Restricted Caller Access table with a status of Requested. * tracking: Calls to the script include are automatically approved. Calls are tracked in the Restricted Caller Access table with a status of Allowed. {#fluent-script-include-object__ul_fjd_4hl_4fc} |
| accessibleFrom | String | Specifies which applications can access the script include. Valid values: * public: All application scopes can call the script include. * package_private: The script include can only be called from the application scope that it's within. {#fluent-script-include-object__ul_m5p_yfl_4fc} Default: package_private |
| active | Boolean | Flag that indicates whether the script include is enabled. Valid values: * true: The script include is callable. * false: The script include isn't callable. {#fluent-script-include-object__ul_otz_jgl_4fc} Default: true |
| protectionPolicy | String | A policy that determines whether someone can view or edit the script include after the application is installed on their instance. If undefined, other application developers can customize the script include. Valid values: * read: Allows anyone to read values from this downloaded or installed script include. No one can change script values on the instance on which they download or install the script include. * protected: Provides intellectual property protection for application developers. Customers who download the script include cannot see the contents of the script field. The script is encrypted in memory to prevent unauthorized users from seeing it in plain text. {#fluent-script-include-object__ul_o3h_nbz_j3c} |
| $meta | Object | Metadata for the application metadata. With the installMethod property, you can map the application metadata to an output directory that loads only in specific circumstances. $meta: { installMethod: 'String' } Valid values for installMethod: * demo: Outputs the application metadata to the metadata/unload.demo directory to be installed with the application when the Load demo data option is selected. * first install: Outputs the application metadata to the metadata/unload directory to be installed only the first time an application is installed on an instance. {#fluent-script-include-object__ul_n3q_y3s_42c} |
[Table 1. Properties]

{#fluent-script-include-object__table_qyv_1pj_4fc}  
In the following example, the script include uses a script from the SampleClass.server.js file.

    import { ScriptInclude } from '@servicenow/sdk/core';

    ScriptInclude({
        $id: Now.ID['sample-script-include'],
        name: 'SampleScriptInclude',
        script: Now.include("./SampleClass.server.js"),
        description: 'some description',
        apiName: 'x_scope.SampleScriptInclude',
        callerAccess: 'tracking',
        clientCallable: true,
        mobileCallable: true,
        sandboxCallable: true,
        accessibleFrom: 'public',
        active: true,
    })


