Initialize a client and get started with sending resources by listing all pipelines.
This article is an overview of how to set up your Buildkite client to interact with the REST API.
In order to access the Buildkite API you must first create an API access token. Follow Buildkite's own documentation on managing API tokens for more information on what to do. Keep in mind that securely storing tokens used with this package is the responsibility of the developer.
Creating a client object is as simple as calling the default initializer with an authorization token.
let client = BuildkiteClient(token: "...") // Using your scoped Buildkite API access token
For more advanced authorization features, see doc:Authorization.
To send a resource, simply use one of the send
methods on the client. This sample is assuming you are sending from inside an async-throwing function.
let response = try await client.send(.pipelines(in: "buildkite"))
let pipelines = response.content
- doc:UsingGraphQL
- doc:Authorization
- doc:Webhooks