import Moonbase from '@moonbaseai/sdk';const moonbase = new Moonbase({ apiKey: process.env.MOONBASE_API_KEY, // This is the default and can be omitted});const collection = await moonbase.collections.retrieve('organizations');console.log(collection.id);
TypeScript SDK on GitHub
View documentation, examples, and source code for the TypeScript SDK.
Install the Python SDK using pip:
Copy
Ask AI
pip install --pre moonbase-sdk
Usage:
Copy
Ask AI
import osfrom moonbase import Moonbasemoonbase = Moonbase( api_key=os.environ.get("MOONBASE_API_KEY"), # This is the default and can be omitted)collection = moonbase.collections.retrieve( id="organizations",)print(collection.id)
Python SDK on GitHub
View documentation, examples, and source code for the Python SDK.
Install the Go SDK:
Copy
Ask AI
go get github.com/moonbaseai/moonbase-sdk-go@v0.1.0-alpha.2
Usage:
Copy
Ask AI
package mainimport ( "context" "fmt" "github.com/moonbaseai/moonbase-sdk-go" "github.com/moonbaseai/moonbase-sdk-go/option")func main() { client := moonbase.NewClient( option.WithAPIKey(os.Getenv("MOONBASE_API_KEY")), // This is the default and can be omitted ) collection, err := client.Collections.Get( context.TODO(), "organizations", moonbase.CollectionGetParams{}, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", collection.ID)}
Go SDK on GitHub
View documentation, examples, and source code for the Go SDK.
Install the Ruby SDK:
Copy
Ask AI
gem "moonbase-sdk", "~> 0.1.0.pre.alpha.2"
Then run:
Copy
Ask AI
bundle install
Usage:
Copy
Ask AI
require "bundler/setup"require "moonbase"moonbase = Moonbase::Client.new( api_key: ENV["MOONBASE_API_KEY"] # This is the default and can be omitted)collection = moonbase.collections.retrieve("organizations")puts(collection.id)
Ruby SDK on GitHub
View documentation, examples, and source code for the Ruby SDK.