Skip to content

Commit

Permalink
Updated set up script to enable studio
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric committed Apr 26, 2024
1 parent 01243f6 commit 5415aca
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion set-up.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,27 @@ const ORG_ID = '1jtZ8D4corGeQgsNmtaFM4'; // Studio Staging Org
console.log(chalk.red('Your cma token may be invalid.'));
return;
}

try {
client.rawRequest({
method: 'PUT',
url: `https://api.contentful.com/spaces/${space.sys.id}/enablements`,
data: {
crossSpaceLinks: { enabled: false },
spaceTemplates: { enabled: false },
studioExperiences: { enabled: true },
},
headers: {
'X-Contentful-Enable-Alpha-Feature': 'enablements',
'X-Contentful-Version': 1,
},
});
} catch (e) {
return {
state: 'error',
error: 'Failed to enable experiences',
stacktrace: e,
};
}
console.log(chalk.green('------------------------------'));
console.log(chalk.green('| |'));
console.log(chalk.green('| Creating Access Tokens |'));
Expand Down

0 comments on commit 5415aca

Please sign in to comment.