---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowSDK framework - iOS

# NowSDK framework - iOS {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The NowSDK framework contains methods that enable the instantiation of various feature services.

## NowSDK - configure(with configuration: NowSDKConfiguration) throws {#ariaid-title2}

Configures NowSDK for use. You must call this function before calling any of the feature services within the Mobile SDK.
Note:  
If the configuration that you pass is invalid, a `NowSDKError` is thrown.
{#NSDK-configure_O__table_b1x_1xw_kqb__entry__3}

| Name | Type | Description |
|-|-|-|
| with configuration | [NowSDKConfiguration](https://servicenow-prod.fluidtopics.net/ULAAiXF2mQ0oV8KZVmHXBA#NowSDKConfigurationiOSAPI "The NowSDKConfiguration class contains configuration information needed to initialize the NowSDK.") | NowSDKConfiguration that contains the information necessary to initialize the service. |
[Table 1. Parameters]

{#NSDK-configure_O__table_b1x_1xw_kqb} {#NSDK-configure_O__table_c1x_1xw_kqb__entry__2}

| Type | Description |
|-|-|
| None, NowSDKError | NowSDKError is thrown if the configuration that you pass is invalid. |
[Table 2. Returns]

{#NSDK-configure_O__table_c1x_1xw_kqb}  
The following code example shows how to call this function.

    guard 
      let jwtUrl = URL(string: "http://13.57.38.237:8080"),
      let instanceUrl = URL(string: "https://mobilecoresdk.service-now.com") else {
        return
      }

    // AuthorizationProvider -- struct conforming to NowSDKAuthorizationProviding protocol
    let authorizationProvider = AuthorizationProvider(userEmail: "sdk@servicenow.com", jwtProviderUrl: jwtUrl, clientId: "deb8756b452d201039231ca568f26511")
            
    // PermissionProvider -- class conforming to DevicePermissionDelegate protocol
    let permissionProvider = PermissionProvider()
    let config = NowSDKConfiguration(authorizationProvider: authorizationProvider, permissionDelegate: permissionProvider, logLevel: .debug)

    do {
      try NowSDK.configure(with: config)
                ...
    } catch {
       print("error is \(error.localizedDescription)")
    }

## NowSDK - core() {#ariaid-title3}

Returns a reference to the SDK core service.
Note:  
Host applications don't need to call this function.
{#NSDK-core__table_lmy_2zw_kqb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#NSDK-core__table_lmy_2zw_kqb} {#NSDK-core__table_mmy_2zw_kqb__entry__2}

| Type | Description |
|-|-|
| Object | Object conforming to the NowCoreServiceProviding protocol is returned if the SDK has been initialized by calling the [NowSDK - configure(with configuration: NowSDKConfiguration) throws](https://servicenow-prod.fluidtopics.net/4_zGfXKAwRDISW2iPsr1eg#NSDK-configure_O "Configures NowSDK for use. You must call this function before calling any of the feature services within the Mobile SDK.") method; otherwise `nil`. |
[Table 4. Returns]

{#NSDK-core__table_mmy_2zw_kqb}  
The following code example shows how to call this function.

    guard let coreService = NowSDK.core() else {
      // Error with NowServiceError.sdkNotConfigured
      return
    }

## NowSDK - makeServiceConfiguration(for instanceUrl: URL) {#ariaid-title4}

Convenience function that feature services can use to construct n NowServiceConfiguration object.
{#NSDK-makeServiceConfiguration_S__table_vkq_41x_kqb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceUrl | URL | URL of the ServiceNow instance that the service will access. |
[Table 5. Parameters]

{#NSDK-makeServiceConfiguration_S__table_vkq_41x_kqb} {#NSDK-makeServiceConfiguration_S__table_wkq_41x_kqb__entry__2}

| Type | Description |
|-|-|
| [NowServiceConfiguration](https://servicenow-prod.fluidtopics.net/A6W2zQ0fOO_VQ9lbo3VKwQ#NowServiceConfigurationiOSStruct "The NowServiceConfiguration structure defines configuration information for a feature service.") | If the specified URL passes basic validity checks, and the service configuration can be properly constructed, returns the NowServiceConfiguration object; otherwise `nil`. |
[Table 6. Returns]

{#NSDK-makeServiceConfiguration_S__table_wkq_41x_kqb}  
The following code example shows how to call this function.

    guard 
      let instanceUrl = URL(string: "https://mobilecoresdk.service-now.com"),
      let serviceConfig = NowSDK.makeServiceConfiguration(for: instanceUrl) else {
        logger.error(message: "Could not create service - service configuration invalid")
        return 
      }


