Skip to content

Commit 5b5b279

Browse files
authored
Update README.md
1 parent 0b3f7ff commit 5b5b279

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1-
# functions-swift
1+
# `functions-swift`
22

3-
A description of this package.
3+
Swift Client library to interact with Supabase Functions.
4+
5+
## Usage
6+
7+
```swift
8+
let client = FunctionsClient(
9+
url: URL(string: "https://project-id.supabase.com/functions/v1")!,
10+
headers: [
11+
"apikey": "project-api-key"
12+
]
13+
)
14+
15+
struct Response: Decodable {
16+
let message: String
17+
}
18+
19+
let response: Response = try await client.invoke(
20+
functionName: "hello-world",
21+
invokeOptions: FunctionInvokeOptions(body: ["name": "Functions"])
22+
)
23+
24+
assert(response.message = "Hello Functions")
25+
```

0 commit comments

Comments
 (0)