import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const restrictedKeyCreatedView = await client.restrictedKeys.create();
console.log(restrictedKeyCreatedView.id);{
"id": "<string>",
"name": "<string>",
"key_secret": "<string>",
"scopes": [
{
"resource_type": "RESOURCE_TYPE_DEVBOXES",
"access_level": "ACCESS_LEVEL_NONE"
}
],
"expires_at_ms": 123
}Create a restricted API key with specific resource scopes. Use a standard API key (ak_) or a restricted key (rk_) with RESOURCE_TYPE_ACCOUNT write scope.
import Runloop from '@runloop/api-client';
const client = new Runloop({
bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});
const restrictedKeyCreatedView = await client.restrictedKeys.create();
console.log(restrictedKeyCreatedView.id);{
"id": "<string>",
"name": "<string>",
"key_secret": "<string>",
"scopes": [
{
"resource_type": "RESOURCE_TYPE_DEVBOXES",
"access_level": "ACCESS_LEVEL_NONE"
}
],
"expires_at_ms": 123
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Was this page helpful?