Can I specify secrets when creating a Code Sandbox via POST API? #5732
-
Hey 👋 , I'm using the CS Container in our docs for API examples and I wanted to dynamically generate a codesandbox with baked API Token, so users work with their data. It's probably not possible right now? I don't see anything about it here https://codesandbox.io/docs/api. Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
andrasbacsai
May 4, 2021
Replies: 1 comment 1 reply
-
Hey, You can use our Here is a payload for defining a simple container sandbox: {
"files": {
"package.json": {
"content": {
"scripts": {
"start": "./node_modules/node/node_modules/.bin/node ./node_modules/nodemon/bin/nodemon.js ./src/index.js"
},
"dependencies": {
"node": "14.2.0"
},
"devDependencies": {
"nodemon": "^1.18.4"
}
}
},
"src/index.js": {
"content": "console.log('helloa')"
},
"index.html": {
"content": "<html>hello</html>"
}
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
petrbrzek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
You can use our
Define API
to dynamically define a sandbox through our API: https://codesandbox.io/docs/api/#define-apiHere is a payload for defining a simple container sandbox: