corsaircloud is a small Go client for a hosted Corsair Cloud
project. It uses only the standard library. Give it your API key, and every
plugin your runtime has is callable over HTTP.
1. Install
corsair monorepo, so go get
resolves it against subdirectory-scoped tags (clients/go/vX.Y.Z). To pin an
exact version:
2. Add your API key
Copy your project’s API key (ck_cloud_…) from the dashboard Overview page.
It’s a server secret; keep it in an environment variable, not in source. The
client derives its own URL from the key:
3. Make a call
Pick a user (a “tenant”), then call any operation on any plugin your runtime has.Call returns the raw JSON result, which you unmarshal into your own type:
Tenant("acme") runs the call as your user “acme”. The arguments map onto one
request: POST /acme/notion/call/pages.searchPage with body
{"args": {"query": "roadmap"}}.
4. Connect a user’s account
A tenant can only call Notion after they have connected their Notion account. Create a connect link and send the user to it:Handle errors
A non-2xx response comes back as*corsaircloud.CorsairError:
Code (machine reason, branch on this), Message, Reason, and
ProviderStatus (the upstream provider’s status, when the error came from them).