Authentication
The OpenCloud SDK requires a Roblox Open Cloud API key for authentication.
Getting an API Key
- Go to the Roblox Creator Dashboard
- Click Create API Key
- Configure the permissions your application needs
- Copy the generated API key
WARNING
Keep your API key secret! Never commit it to version control or share it publicly.
Using the API Key
Pass your API key when creating the OpenCloud client:
typescript
import { OpenCloud } from "@relatiohq/opencloud";
const client = new OpenCloud({
apiKey: "your-api-key-here"
});Environment Variables
It's recommended to store your API key in environment variables:
typescript
const client = new OpenCloud({
apiKey: process.env.ROBLOX_API_KEY!
});Using .env files
Create a .env file in your project root:
ROBLOX_API_KEY=your-api-key-hereThen load it in your application (using a package like dotenv):
typescript
import "dotenv/config";
import { OpenCloud } from "@relatiohq/opencloud";
const client = new OpenCloud({
apiKey: process.env.ROBLOX_API_KEY!
});Permissions
When creating your API key, ensure it has the appropriate permissions for the resources you need to access:
- Users - Read user information
- Groups - Read group information
- Assets - Upload and manage assets
- And more...
Refer to the Roblox Open Cloud documentation for the full list of available permissions.