---
title: "init(options:)"
framework: opendirectory
role: symbol
role_heading: Initializer
path: "opendirectory/odsession/init(options:)"
---

# init(options:)

Creates a session object directed over proxy to another host.

## Declaration

```swift
init(options inOptions: [AnyHashable : Any]! = [:]) throws
```

## Parameters

- `inOptions`: A dictionary of options to associate with the session. Can be nil.

## Return Value

Return Value The created session object.

## Discussion

Discussion note: In Swift, this API is imported as an initializer and is marked with the throws keyword to indicate that it throws an error in cases of failure. You call this method in a try expression and handle any errors in the catch clauses of a do statement, as described in Error Handling in The Swift Programming Language and About Imported Cocoa Error Parameters.

## See Also

### Related Documentation

- [ODSession](opendirectory/odsession.md)

### Creating and Accessing Sessions

- [default()](opendirectory/odsession/default().md)
