You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**This SDK is compatible with Appwrite server version 1.0.0-RC1. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).**
10
+
**This SDK is compatible with Appwrite server version 1.0.0. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-swift/releases).**
11
11
12
12
> This is the Swift SDK for integrating with Appwrite from your Swift server-side code. If you're looking for the Apple SDK you should check [appwrite/sdk-for-apple](https://github.com/appwrite/sdk-for-apple)
13
13
@@ -33,7 +33,7 @@ Add the package to your `Package.swift` dependencies:
Initialize your SDK with your Appwrite server API endpoint and project ID which can be found in your project settings page and your new API secret Key project API keys section.
58
+
59
+
```swift
60
+
importAppwrite
61
+
62
+
funcmain() {
63
+
let client =Client()
64
+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
65
+
.setProject("5df5acd0d48c2") // Your project ID
66
+
.setKey("919c2d184...a2ae413dad2") // Your secret API key
67
+
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
68
+
}
69
+
```
70
+
71
+
### Make Your First Request
72
+
73
+
Once your SDK object is initialized, create any of the Appwrite service objects and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
When an error occurs, the Appwrite Swift SDK throws an `AppwriteError` object with `message` and `code` properties. You can handle any errors in a catch block and present the `message` or `localizedDescription` to the user or handle it yourself based on the provided error information. Below is an example.
120
+
121
+
```swift
122
+
importAppwrite
123
+
124
+
funcmain() {
125
+
let users =Users(client)
126
+
127
+
do {
128
+
let users =tryawait users.list()
129
+
print(String(describing: users.toMap()))
130
+
} catch {
131
+
print(error.localizedDescription)
132
+
}
133
+
}
134
+
```
135
+
136
+
### Learn more
137
+
138
+
You can use the following resources to learn more and get help
139
+
140
+
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
- 🚂 [Appwrite Swift Playground](https://github.com/appwrite/playground-for-swift-server)
144
+
145
+
53
146
## Contribution
54
147
55
148
This library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.
0 commit comments