ClearBlade IoT Core API's Go client library
Create a service account in your project and download the credentials .json file.
To authenticate API requests you can use one of two options:
-
Define an environment variable named
CLEARBLADE_CONFIGURATION
which represents the path to the credentials .json file. Example:export CLEARBLADE_CONFIGURATION=/path/to/file.json
-
Pass in credentials via the Service options:
credentials := `{"systemKey":"systemkeyhere","token":"tokenhere","url":"https://iot.clearblade.com","project":"test"}` service, err := iot.NewService(ctx, iot.WithServiceAccountCredentials(credentials)) if err != nil { return err }
See the Authorization documentation for authorizing SDK with ClearBlade iot-core.
View the Go sections of these Samples.