<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKitTest",
  "identifier" : "/documentation/StoreKitTest/SKTestSession/init(contentsOf:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "StoreKit Test"
    ],
    "preciseIdentifier" : "c:objc(cs)SKTestSession(im)initWithContentsOfURL:error:"
  },
  "title" : "init(contentsOf:)"
}
-->

# init(contentsOf:)

Initializes the test session with a configuration file you provide through a URL.

```
init(contentsOf fileURL: URL) throws
```

## Parameters

`fileURL`

A file URL for a configuration file with a .`storekit` extension.

## Discussion

The file must have a `.storekit` extension. Create a configuration file in Xcode by selecting File > New > File and choosing StoreKit Configuration File.

To return all settings in the test session to the states defined in this StoreKit configuration file, call [`resetToDefaultState()`](/documentation/StoreKitTest/SKTestSession/resetToDefaultState()).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)