{
const url = 'https://api.random.org/json-rpc/4/invoke';
const payload = {
"jsonrpc": "2.0",
"method": "generateIntegers",
"params": {
"apiKey": secretKey,
"n": 6,
"min": 1,
"max": 6,
"replacement": true
},
"id": 42
};
const params = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
};
const req = fetch(url, params)
.then(response => response.json())
.then(response => response.result.random.data)
return req
}