Seongjoo Park
Seongjoo Park

Reputation: 61

How can I hide api key in bixby-studio?

How can I hide api key in bixby-studio?

I want to make bixby capsule Using API data. but I can't find how to hide API key

this is example code at 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
}

I want to hide my API key

Upvotes: 3

Views: 127

Answers (1)

Pete Haas
Pete Haas

Reputation: 1800

Bixby provides the ability to save secrets and safely access them from your code.

https://bixbydevelopers.com/dev/docs/reference/JavaScriptAPI/secret

  1. Define the secret you want to define at https://bixbydevelopers.com/
  2. Access it with secret.get([your secret name])

bixby dev site

Upvotes: 6

Related Questions