---
title: "init(code:)"
framework: authenticationservices
role: symbol
role_heading: Initializer
path: "authenticationservices/asonetimecodecredential/init(code:)"
---

# init(code:)

Creates a one-time passcode (OTP) credential.

## Declaration

```swift
init(code: String)
```

## Parameters

- `code`: The OTP.
