<!--
{
  "availability" : [
    "SwiftPM: 5.5.0 - 5.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/Package/Dependency/package(name:url:revision:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription0A0C10DependencyC7package4name3url8revisionAESS_S2StFZ"
  },
  "title" : "package(name:url:revision:)"
}
-->

# package(name:url:revision:)

Adds a remote package dependency with a specific revision requirement.

```
static func package(name: String, url: String, revision: String) -> Package.Dependency
```

## Parameters

`name`

The name of the package, or nil to deduce it from the URL.

`url`

The valid Git URL of the package.

`revision`

A dependency requirement. See static methods on [`Package.Dependency.Requirement`](/documentation/PackageDescription/Package/Dependency/Requirement-swift.enum) for available options.

## Return Value

A `Package.Dependency` instance.

## Discussion

```swift
.package(url: "https://example.com/example-package.git", revision: "aa681bd6c61e22df0fd808044a886fc4a7ed3a65"),
```

---

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)