<commit_before>---
section: libraries
toc: true
description: How to install, initialize and use Auth0.Swift
url: /libraries/auth0-swift
topics:
  - libraries
  - swift
contentType:
    - how-to
    - index
useCase: enable-mobile-auth
---

# Auth0.swift

Auth0.swift is a client-side library for Auth0.

::: note
Check out the [Auth0.swift repository](https://github.com/auth0/Auth0.swift) on GitHub.
:::

## Requirements

- iOS 9+
- Xcode 10+
- Swift 4+

## Installation

### Cocoapods

If you are using [Cocoapods](https://cocoapods.org), add this line to your `Podfile`:

```ruby
pod 'Auth0', '~> 1.0'
```

Then run `pod install`.

::: note
For more information on Cocoapods, check [their official documentation](https://guides.cocoapods.org/using/getting-started.html).
:::

### Carthage

If you are using [Carthage](https://github.com/Carthage/Carthage), add the following line to your `Cartfile`:

```ruby
github "auth0/Auth0.swift" ~> 1.0
```

Then run `carthage bootstrap`.

::: note
For more information about Carthage usage, check [their official documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos).
:::

## Adding Auth0 Credentials

You will need to add an `Auth0.plist` file, containing your Auth0 client id and domain, to your main bundle. Here is an example of the file contents:

```xml<commit_msg>Added installation instructions for SPM [SDK-2016] (#9487)<commit_after>---
section: libraries
toc: true
description: How to install, initialize and use Auth0.Swift
url: /libraries/auth0-swift
topics:
  - libraries
  - swift
contentType:
    - how-to
    - index
useCase: enable-mobile-auth
---

# Auth0.swift

Auth0.swift is a client-side library for Auth0.

::: note
Check out the [Auth0.swift repository](https://github.com/auth0/Auth0.swift) on GitHub.
:::

## Requirements

- iOS 9+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
- Xcode 11.4+ / 12.x
- Swift 4.x / 5.x

## Installation

### Cocoapods

If you are using [Cocoapods](https://cocoapods.org), add this line to your `Podfile`:

```ruby
pod 'Auth0', '~> 1.0'
```

Then run `pod install`.

::: note
For more information on Cocoapods, check [their official documentation](https://guides.cocoapods.org/using/getting-started.html).
:::

### Carthage

If you are using [Carthage](https://github.com/Carthage/Carthage), add the following line to your `Cartfile`:

```ruby
github "auth0/Auth0.swift" ~> 1.0
```

Then run `carthage bootstrap`.

::: note
For more information about Carthage usage, check [their official documentation](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos).
:::

### SPM

If you are using the Swift Package Manager, open the following menu item in Xcode:

**File > Swift Packages > Add Package Dependency...**

In the **Choose Package Repository** prompt add this url: 

```text
https://github.com/auth0/Auth0.swift.git
```

Then press **Next** and complete the remaining steps.

> For further reference on SPM, check [its official documentation](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app).

## Adding Auth0 Credentials

You will need to add an `Auth0.plist` file, containing your Auth0 client id and domain, to your main bundle. Here is an example of the file contents:

```xml
{'fraction_non_alphanumeric': 0.1353406326034063, 'fraction_numerical': 0.020072992700729927, 'mean_word_length': 4.115085536547434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4426309', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1084, 'n_words': 343}