swift-atproto is a atproto library.
Add the SwiftAtproto
as a dependency:
let package = Package(
// name, platforms, products, etc.
dependencies: [
// other dependencies
.package(url: "https://github.com/nnabeyang/swift-atproto", from: "0.19.0"),
],
targets: [
.executableTarget(name: "<executable-target-name>", dependencies: [
// other dependencies
.product(name: "SwiftAtproto", package: "swift-atproto"),
]),
// other targets
]
)
Add the following to your Podfile:
pod 'SwiftAtproto'
Code generation is done as follows:
swift package plugin --allow-writing-to-package-directory \
--allow-network-connections all:443 swift-atproto --outdir <OUTPUT_DIR> --atproto-configuration ./.atproto.json
Sample configuration file is as follows:
{
"dependencies": [
{
"location": "https://github.com/bluesky-social/atproto.git",
"lexicons": [
{ "prefix": "app.bsky", "path": "lexicons/app/bsky" },
{ "prefix": "com.atproto", "path": "lexicons/com/atproto" }
],
"state": {
"tag": "@atproto/api@0.12.18"
}
},
{
"location": "https://github.com/whtwnd/whitewind-blog.git",
"lexicons": [{ "prefix": "com.whtwnd", "path": "lexicons/com/whtwnd" }],
"state": {
"tag": "v1.0.1"
}
}
],
"module": "Sources/Lexicon"
}
swift-atproto is published under the MIT License, see LICENSE.