如何在bixby-studio中隐藏api密钥?
我想使用API数据制作bixby胶囊。 但我找不到如何隐藏API密钥
这是code/requestmovie.js
module.exports.function = function requestmovie () {
const http = require('http');
const console = require("console")
// here !!
let url = 'url with api key'
let response = http.getUrl(url, {format: 'xmljs'})
let MovieList = {}
let lists = response.movieList
MovieList.firstmovietitle = lists[0].movieNm
return MovieList
}
我想隐藏我的API密钥
答案 0 :(得分:4)
Bixby提供了保存机密并从您的代码安全访问它们的功能。
https://bixbydevelopers.com/dev/docs/reference/JavaScriptAPI/secret