Gleam functions for interacting with the spacetraders.io game API
Find a file
Lily Rose 1684217cd4
Some checks are pending
test / test (push) Waiting to run
Update readme to link to client implementations
2025-07-09 17:22:28 +10:00
.github/workflows Initial commit 2025-07-09 02:07:44 +10:00
src Initial commit 2025-07-09 02:07:44 +10:00
test Initial commit 2025-07-09 02:07:44 +10:00
.gitignore Initial commit 2025-07-09 02:07:44 +10:00
gleam.toml Bump version to v1.1.0 2025-07-09 16:51:49 +10:00
LICENSE.md Initial commit 2025-07-09 02:07:44 +10:00
manifest.toml Update dependency versions 2025-07-09 16:51:33 +10:00
README.md Update readme to link to client implementations 2025-07-09 17:22:28 +10:00
spacetraders.openapi.json Initial commit 2025-07-09 02:07:44 +10:00

spacetraders_sdk

Package Version Hex Docs

For specific http client implementations see spacetraders_api_httpc and spacetraders_api_fetch

gleam add spacetraders_sdk@1
import spacetraders_api
import spacetraders_models/agent_token
import gleam/httpc

pub fn main() -> Nil {
  let assert Ok(agent_token) = agent_token.parse("...")
  case spacetraders_api.get_account_request(agent_token) |> httpc.send_bits {
    Ok(res) -> {
      echo spacetraders_api.get_account_response(res)
      Nil
    }
    Error(err) -> {
      echo err
      Nil
    }
  }
}

Further documentation can be found at https://hexdocs.pm/spacetraders_sdk.

Development

gleam run   # Run the project
gleam test  # Run the tests