The SDK is designed to function in a Node.js environment. Browser-based requests are not supported due to CORS restrictions.
Scaleway JS software development kit (SDK)
The Scaleway JS SDK is a dynamic tool for developers who use JavaScript to interact with Scaleway’s cloud services. It makes complex tasks like managing servers, handling storage operations, and setting up networking more manageable by automating intricate API calls and the authentication process. This SDK is instrumental for integrating or programmatically managing Scaleway’s cloud resources.
Installing the JS SDK
To use the SDK, you need an access key and a secret key for the Scaleway API. Refer to Scaleway’s documentation on API keys for instructions on creating and retrieving these keys.
Below is a basic setup example:
import { Registry, createClient } from '@scaleway/sdk'const client = createClient({accessKey: 'SCWXXXXXXXXXXXXXXXXX',secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',defaultRegion: 'fr-par',defaultZone: 'fr-par-1',})const api = new Registry.v1.API(client)
Using the SDK
The SDK is written in TypeScript, offering the full benefits of this language.
-
For any product, its types are available under
Product.version
. For example, access theImage
interface of Registry v1 usingRegistry.v1.Image
. -
Scaleway also provides exports of errors under the
Errors
namespace, which helps differentiate various error cases, likeErrors.PermissionsDeniedError
.
Contributing
This project is in the early stages of development and is actively evolving. If you are interested in contributing, join us at #opensource in Scaleway’s Slack community for discussions.
Further resources
- SDK reference documentation
- SDK example projects
- Developers website (API documentation)