Create a new API
const { result, error } =await unkey.apis.create({ name: "Unkey production" });
if (error) {
// handle potential network or bad request error
// a link to our docs will be in the `error.docs` field
console.error(error.message);
return;
}
console.log(result);
{
"result": {
"apiId" : "api_123"
}
}
const { result, error } =await unkey.apis.create({ name: "Unkey production" });
if (error) {
// handle potential network or bad request error
// a link to our docs will be in the `error.docs` field
console.error(error.message);
return;
}
console.log(result);
{
"result": {
"apiId" : "api_123"
}
}
Was this page helpful?
const { result, error } =await unkey.apis.create({ name: "Unkey production" });
if (error) {
// handle potential network or bad request error
// a link to our docs will be in the `error.docs` field
console.error(error.message);
return;
}
console.log(result);
{
"result": {
"apiId" : "api_123"
}
}